#include <stdio.h>int main(){ int N,i,j,n,count,sum,a; n = 0; scanf("%d",&N); n = N; count = 0; while(n > 0){ n = n / 10; count++; //统计输入数字的位数 } //printf("%d",count); for(i=0; i<10; i++){ sum = 0; //内层循环结束后 将统计置为0 a = 0; n = N; for(j=1; j<=count; j++){ a = n % 10; n = n / 10; if(i == a){ sum++; } printf("%d",sum); } if(sum > 0){ printf("%d:%d\n",i,sum); } } return 0; }
- 2 回答
- 0 关注
- 1257 浏览
添加回答
举报
0/150
提交
取消