标签:col stat next 变更 char ext 大小 string public
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); } }
标签:col stat next 变更 char ext 大小 string public
原文地址:https://www.cnblogs.com/yangshuyuan1009/p/9831102.html