代碼:
1 import java.io.*; 2 public class Main { 3 public static void main (String [] args) throws IOException{ 4 char c; 5 c=(char) System.in.read(); 6 while(c!='?') { 7 if(c>='A'&&c<='Z') { 8 c+=32; 9 } 10 else if(c>='a'&&c<='z') { 11 c-=32; 12 } 13 else { 14 c=c; 15 } 16 System.out.print(c); 17 c=(char) System.in.read(); 18 } 19 } 20 }