View Code of Problem 107

#include<stdio.h>
#include<string.h>
int main(){
	int m,n;
	while(scanf("%d %d",&m,&n)!=EOF){
		int a[10] = {0};
		int i,num;
		for(i = m;i <= n ;i++){
			int num = i;
			while(num>0){
				a[num%10]++;
				num = num/10;
			}
		}
		for(i = 0;i < 10; i++){
			if(i!=9)
				printf("%d ",a[i]);
			else
				printf("%d",a[i]);
		}
		printf("\n");
	}	
	return 0;
}

Double click to view unformatted code.


Back to problem 107