import java.util.Scanner;
public class Demo1 {
public static void main(String[] args) {
int small = 0;
int big = 0;
int num = 0;
int space = 0;
System.out.println("请输入要统计的字符串: ");
Scanner scanner = new Scanner(System.in);
String str = scanner.nextLine();
for (int i = 0; i <str.length(); i++) {
char ch = str.charAt(i);
if(ch>='A' && ch<='Z'){
big+=1;
}else if(ch>='a' && ch<='z'){
small+=1;
}else if(ch>='0' && ch<='9'){
num+=1;
}else if(ch ==' '){
space+=1;
}
}
System.out.println("小写字母:"+small);
System.out.println("大写字母:"+big);
System.out.println("数字:"+num);
System.out.println("空格"+space);
}
}