#include<stdio.h> int main(){ int l,r,temp,i,I; while(scanf("%d%d",&l,&r)!=EOF){ int num[10]={0}; for(i=l;i<=r;i++){ I=i; while(I!=0){ temp=I%10; I=I/10; num[temp]++; } } for(i=0;i<10;i++){ printf("%d",num[i]); if(i!=9) printf(" "); } } } |
Double click to view unformatted code.