#include<stdio.h>
#include<string.h>
int main()
{
char a[105];
char b[26];
int n;
while(gets(a)!='\n')
{
int s[100] = { 0 };
for (int x = 0; x < 26; x++)
{
int c = 0;
n=strlen(a);
b[x] = x + 65;
for (int i = 0; i <n; i++)
{
if (b[x] == a[i])
{
c++;
s[x] = c;
}
}
if (s[x]>=1)
{
printf("%c: %d\n", b[x], s[x]);
}
}
printf("\n");
}
return 0;
}
C语言编程题 33.编程实现输入一行字符串,统计输出字符串中出现过的大写英文字母及其数量。
最新推荐文章于 2023-02-28 22:16:35 发布