View Code of Problem 107

#include<stdio.h>
int main(){
	int m;
	int n;
	while(scanf("%d%d",&m,&n)!=EOF){

	int a[11]={0};
	
	for(int i=m;i<=n;i++){
		int d=i;
		int t;
		do{
			t=d%10;
			a[t]++;
			d=d/10;
		}while(d>0);
	}
	for(int i=0;i<9;i++){
		printf("%d ",a[i]);
	}
	printf("%d",a[9]);
	printf("\n");
	}
	
	return 0;
}

Double click to view unformatted code.


Back to problem 107