/**
* 需求:统计一个字符串中大写字母字符,小写字母字符,数字字符出现的次数,其他字符出现的次数。
*/
public static void main(String[] args) {
String s = "ABCDEabcd123456!@#$%^";
int big = 0;
int small = 0;
int count = 0;
int other = 0;
for (int i = 0; i < s.length(); i++) {
char c1 = s.charAt(i);
if(c1>='A' && c1<= 'Z'){
big++;
}else if (c1>='a' && c1<='z') {
small++;
}else if (c1>='0' && c1<='9') {
count++;
}else {
other++;
}
}
System.out.println(big);
System.out.println(small);
System.out.println(count);
System.out.println(other);
}