pat乙级1021

#include<stdio.h>
#include<string.h>
int main(){
int s[11]={0};
char c;
while((c=getchar())!='\n'){
// scanf("%c",&c);
s[c-'0']++;
}
for(int i=0;i<10;i++){
if(s[i]!=0)
printf("%d:%d\n",i,s[i]);
}
return 0;
}

posted @ 2019-02-19 19:31  捕鱼儿海  阅读(77)  评论(0编辑  收藏  举报