View Code of Problem 107

#include <stdio.h>

int main(){
	int m,n;
	while(scanf("%d %d",&m,&n)!=EOF){
		int a[10]={0};
		for(int i=m;i<=n;i++){
			int k=i;
			while(k/10!=0){
				a[k%10]++;
				k=k/10;
			}
			a[k]++;
		}
		for(int i=0;i<10;i++){
			if(i!=9){
				printf("%d ",a[i]);
			}else{
				printf("%d\n",a[i]);
			}
		}
	}
}

Double click to view unformatted code.


Back to problem 107