#include<stdio.h> int main() { char a[100]; int i,zm=0,kg=0,sz=0,qt=0; gets(a); for (i = 0; a[i] != '\0'; i++) { if (a[i] >= 'a' && a[i] <= 'z') zm++; else if (a[i] >= 'A' && a[i] <= 'Z') zm++; else if (a[i] <= '9' && a[i]>='0') sz++; else if (a[i] == ' ') kg++; else qt++; } printf("字母的个数为%d\n",zm); printf("数字的个数为%d\n",sz); printf("空格的个数为%d\n",kg); printf("其他字符的个数为%d\n",qt); return 0; }