View Code of Problem 107

#include<bits/stdc++.h>
using namespace std;

int main(){
   	int m,n;
  	while(cin>>m>>n){
  		int num[10]={0};
	  	for(int i = m; i <= n; i++){
   			int tmp = i;
   			while(tmp>0){
   				num[tmp%10]++;
   				tmp/=10;
		   	}
	  	}
	  	for(int i = 0; i < 10; i++){
	  		cout<<num[i];
	  		if(i!=9) cout<<" ";
	  		else cout<<endl;
		}
	}
}

Double click to view unformatted code.


Back to problem 107