View Code of Problem 107

#include<stdio.h>


int main()
{

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

Double click to view unformatted code.


Back to problem 107