View Code of Problem 107

#include<bits/stdc++.h>
using namespace std;
int main(){
	int m,n;
	while(scanf("%d %d",&m,&n)!=EOF){
		string s;
		int a[10]={0};
		for(int i=m;i<=n;i++){
			s=to_string(i);
			for(int j=0;j<s.size();j++){
				a[s[j]-48]++;
			}
		}
		for(int i=0;i<9;i++){
			cout<<a[i]<<" "; 
		}
		cout<<a[9]<<endl;
	}
}

Double click to view unformatted code.


Back to problem 107