View Code of Problem 107

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main()
{
    int m,n;
    while(scanf("%d %d",&m,&n)!=EOF){
        int num[10]={0},k=0;
        for(int i=m;i<=n;i++){
            int tmp=i;
            while(tmp>0){
                num[tmp%10]++;
                tmp/=10;
            }
        }
        for(int i=0;i<10;i++){
            printf("%d",num[i]);
            if(i==9){
                printf("\n");
            }else{
                printf(" ");
            }
        }
    }
    return 0;
}

Double click to view unformatted code.


Back to problem 107