编写程序,输入一个字符,判断它是否为小写字母,如果是,将它转化成大写字母,否则,不转换

import java.io.IOException;
public class ZhiFuChuan {
public static void main(String[] args)throws IOException{
char ch = (char)System.in.read();
if(ch >='a'&&ch <='z'){
ch -=32;
}
System.out.println("判断结果:"+ch);
}
}

猜你喜欢

转载自www.cnblogs.com/sha-/p/10786328.html