#include<stdio.h> #include<string.h> #include<malloc.h> int main() { int m,n,i,j; while(scanf("%d %d",&m,&n)!=EOF) { int a[10]={0}; for(i=m;i<=n;i++) { int temp=i; while(temp) { j=temp%10; temp=temp/10; a[j]++; } } for(i=0;i<9;i++) printf("%d ",a[i]); printf("%d\n",a[9]); } return 0; } |
Double click to view unformatted code.