public static void main(String[] args) {
Scanner sc=new Scanner();
("请输入一个字符串");
String input=();
int countUpper = 0; // 大写字母
int countLower = 0; // 小写字母
int countNumber = 0; // 数字
int countOther = 0; // 其他字符
char[] array=();
for (int i = 0; i < ; i++) {
char ch=array[i];// 当前单个字符
if ('A' <= ch && ch <= 'Z') {
countUpper++;
} else if ('a' <= ch && ch <= 'z') {
countLower++;
} else if ('0' <= ch && ch <= '9') {
countNumber++;
} else {
countOther++;
}
}
("大写字母有:" + countUpper);
("小写字母有:" + countLower);
("数字有:" + countNumber);
("其他字符有:" + countOther);
}
}