View Code of Problem 107

#include<stdio.h>

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

Double click to view unformatted code.


Back to problem 107