发布网友 发布时间:2024-10-18 22:34
共1个回答
热心网友 时间:2024-11-18 16:57
#include <stdio.h>
int main()
{
char ch;
int Cap = 0;
int Sma = 0;
int Oth = 0;
while ((ch = getchar()) != '#')
{
if (ch >= 'A' && ch <= 'Z')
{
Cap++;
}
else if (ch >= 'a' && ch <= 'z')
{
Sma++;
}
else
{
Oth++;
}
}
printf("大写字母:%d\n", Cap);
printf("小写字母:%d\n", Sma);
printf("其他字符:%d\n", Oth);
return 0;
}