输入:从键盘输入一个字符,判断该字符是否大写字母、小写字母、数字字符或其他字符。分别输出对应的提示信息。
输出:输入一个字符。
样例输入:如果该字符是大写字母,则输出“upper”;若是小写字母,则输出“lower”;若是数字字符,则输出“digit”;若是其他字符,则输出“other”。(输出不含双引号)。
样例输出:1
程序代码:digit
import java.util.*;
public class Main
{
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
String a=input.nextLine();
char ch=a.charAt(0);
if(ch>='a'&&ch<='z')
System.out.println("lower");
else if(ch>='A'&&ch<='Z')
System.out.println("upper");
else if(ch>='0'&&ch<='9')
System.out.println("digit");
else
System.out.println("other");
}
}