View Code of Problem 107

#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++){
			if(i==0)
				num[0]++;
			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(" ");
			else
				printf("\n");
		}
	}
}

Double click to view unformatted code.


Back to problem 107