#include
#include
int main()
{
char c;
int digit = 0, upper = 0, lower = 0, space = 0, other = 0;
while (scanf("%c", &c) == 1 && c != '\n')
{
if (isdigit(c))
++digit;
else if (isupper(c))
++upper;
else if (islower(c))
++lower;
else if (isspace(c))
++space;
else
++other;
}
printf("%d Digit(s), %d Upper Case(s), %d Lower Case(s), %d Space(s), %d Other(s)\n", digit, upper, lower);
}
三年前估计我可以帮你,现在姐毕业两年了,这东西早忘光了。多看看课本问题应该不难解决!