回复 53楼 花脸
你直接复制到你的编译器,我就不信,这下还不对。
#include <stdio.h>
#include <ctype.h>
int main(void)
{
int upp, low, dig;
char ch;
upp = low = dig = 0;
printf("please input string:\n");
for (; (ch = getchar()) != '\n';)
{
if (islower(ch))
low++;
else if (isupper(ch))
upp++;
else if (isdigit(ch))
dig++;
}
printf("\nupper case: %d\n", upp);
printf("lower case: %d\n", low);
printf("digit : %d\n", dig);
return 0;
}