View Code of Problem 107

#include<iostream>
#include<string>
#include<cstring>
#include<math.h>
#include<algorithm>
using namespace std;

int main(){
	int m,n;

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

Double click to view unformatted code.


Back to problem 107