View Code of Problem 107

#include<iostream>
#include<cstring>
#include<math.h>
using namespace std;
int main(){
	int m,n;

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

Double click to view unformatted code.


Back to problem 107