Java

yukikage 发表于 10个月前 · 关联问题 字符转换

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char a = sc.next().charAt(0); if (a >= 'A' && a <= 'Z') System.out.println((char) (a + 32)); else if (a >= 'a' && a <= 'z') System.out.println((char) (a - 32)) ; else System.out.println((int)a); } }