-->
当前位置:首页 > 题库 > 正文内容

程序填空题:统计字符串中0-9的出现次数。

Luz4年前 (2021-05-10)题库1495

```c
#include
#include
int main()
{
char s[80];
static int count[10];
int i;
scanf("%s", s);
for(i=0;i<@@[strlen(s)](4);i++)
if(s[i]>='0'&&s[i]<='9') @@[count[s[i]-'0']++](6);
for(i=0;i<10;i++) printf("%d",count[i]);
return 0;
}
```






答案:
第1空:strlen(s)

第2空:count[s[i]-'0']++

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。