View Code of Problem 107

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main (){
	int m, n;
	while(~scanf("%d%d", &m, &n)){
		int a[10] = {0};
		for(int i = m;i <= n;i++){
			int k = i;
			while(k>0){
				a[k%10]++;
				k /= 10;
			}
		}
		for(int i = 0;i < 10;i++){
			if(i>0) printf(" ");
			printf("%d", a[i]);
		}
		printf("\n");
	}

	return 0;
}

Double click to view unformatted code.


Back to problem 107