View Code of Problem 107

#include <cstdio>
#include <iostream>
#include <string>
using namespace std;
int main(){
	int m,n;
	while(cin>>m>>n){
		int num[10]={0};
		for(int i=m;i<=n;i++){
			string ss=to_string(i);
			int len=ss.length();
			for(int j=0;j<len;j++){
				int kk=ss[j]-'0';
				num[kk]++;
			}
		}
		for(int i=0;i<10;i++){
			if(i!=9){
				printf("%d ",num[i]);
			
			}
			else{
				printf("%d\n",num[i]);
			}
		}
	} 
	return 0;
} 

Double click to view unformatted code.


Back to problem 107