import java.util.Scanner; public class H4{ public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println("请输入一个字符"); char ch = scan.next().charAt(0);//97~122 65~90 if(ch>='a'&&ch<='z'){//小写字母 ch -= 32; }else if(ch>='A'&&ch<='Z'){ ch += 32; } System.out.println(ch); } }