标签:blog java io for ar div amp log
import java.io.*; public class Main { public static void main(String args[]){ BufferedReader bufReader = new BufferedReader(new InputStreamReader(System.in)); String strBuf; try { while ((strBuf = bufReader.readLine()) != null){ System.out.println(cover(strBuf)); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public static String cover(String str){ int len = str.length(); char[] chs = new char[len]; int j=0; for(int i=len-1;i>=0;i--){ if(str.charAt(i) != ‘ ‘){ chs[j] = str.charAt(i); if(chs[j]>=‘a‘&&chs[j]<=‘z‘) chs[j]-=32; else if(chs[j]>=‘A‘&&chs[j]<=‘Z‘) chs[j]+=32; j++; } } return String.valueOf(chs); } }
标签:blog java io for ar div amp log
原文地址:http://www.cnblogs.com/longneo/p/3925982.html