public class Test5 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("请输入一个字符串");
String s = sc.nextLine();
int big = 0;
int small = 0;
int num = 0;
int other = 0;
for (int x = 0; x < s.length(); x++) {
char c = s.charAt(x);
if (c >= 'A' && c < 'Z') {
big++;
} else if (c >= 'a' && c <= 'z') {
small++;
} else if (c >= '0' && c <= '9') {
num++;
} else {
other++;
}
}
System.out.println("输入的字符串中大写字母:" + big + "个,小写字母:" + small + "个,数字:" + num + "个,其他字符:" + other + "个");
}
}