```java//输入一串字符统计大写字母个数小写字母个数及特殊符号并输出public static void test5(String str){char[] s = str.toCharArray();int a=0,b=0,c=0,d=0;for (char ss : s){if (ss>='A' && ss<='Z'){a++;}else if(ss>='a' && ss<='z'){b++;}else if(ss>='0' && ss<='9'){c++;}else{d++;}}System.out.println("大写字母有"+a+"个");System.out.println("小写字母有"+b+"个");System.out.println("数字有"+c+"个");System.out.println("特殊符号有"+d+"个");/*C:char t;int a=0,b=0,c=0,d=0;while( (t=getchar()) != '\n' ){if (t>='A' && t<='Z'){a++;}else if(t>='a' && t<='z'){b++;}else if(t>='0' && t<='9'){c++;}else{d++;}}printf("大写:%d 小写:%d 数字:%d 特殊字符:%d ",a,b,c,d);*/}