View Code of Problem 107

#include<iostream>
#include<cstring>
#include<math.h>
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!=0){
//				cout<<k%10;
				a[k%10]++;
				k=k/10;
			}
		}
		for(int i=0;i<10;i++){
			if(i==9) cout<<a[i]<<endl;
			else cout<<a[i]<<" ";
		}
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 107