写出完整的程序,关键地方加上注释
C莱鸟群:205103464
#include <stdio.h>
void main()
{
char ch = 0;
int i;
int a[10] = {0};
while (ch != '?')
{
scanf("%c", &ch);
if (ch >= '0' && ch <= '9')
{
a[ch - '0']++;
}
}
for (i = 0; i < 10; i++)
{
printf("%d出现次数:%d\n", i, a[i]);
}
}
void main()
{
char ch = 0;
int i;
int a[10] = {0};
while (ch != '?')
{
scanf("%c", &ch);
if (ch >= '0' && ch <= '9')
{
a[ch - '0']++;
}
}
for (i = 0; i < 10; i++)
{
printf("%d出现次数:%d\n", i, a[i]);
}
}
温馨提示:答案为网友推荐,仅供参考