View Code of Problem 107

#include<bits/stdc++.h>

using namespace std;

int main()
{
    int m,n;
    while (cin >> m >>n){
        int a[10] = {0};
        int p;
        for(int i = m; i <= n; i++){
            p = i;
            while (p != 0){
                a[p % 10]++;
                p /= 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