003
#include<stdio.h>
#include <string.h>
int main()
{
char s[1005];
int a[15]={0};
int len,t;
scanf("%s",s);
len=strlen(s);
t=0;
for(int i=0;i<len;i++)
{
t=s[i]-48; //把字符串的字符弄到数组里,注意字符“0”转换为int型为它的ASCII码“48”,
a[t]++; //因此数字要减去48。此处数组a[]的下标正好与数字同步
}
for(int j=0;j<10;j++)
{
if(a[j] != 0)
{
printf("%d:%d\n",j,a[j]);
}
}
return 0;
}