食尚峰汇
import java.util.Scanner;public class A04 { public static void main(String args[]) { System.out.println("请输入字符串:"); String s = new Scanner(System.in).next(); System.out.println("输出结果:"); for (char c : s.toCharArray()) { if (c >= 'a' && c <= 'z') { c -= 32; } else if (c >= 'A' && c <= 'Z') { c += 32; } System.out.print(c); } }}