#include <stdio.h>
#include <string.h>
int
main() {
int ans[10], i;
char s[1005];
scanf("%s", s);
for( i = 0; i < 10; i++ ) {
ans[i] = 0;
}
for( i = 0; i < strlen(s); i++ ) {
ans[s[i] - '0']++; ///
}
for( i = 0; i < 10; i++ ) {
if( ans[i] != 0 ) {
printf("%d:%d\n", i, ans[i]);
}
}
return 0;
}
PAT L1-003. 个位数统计
最新推荐文章于 2019-11-02 12:13:53 发布