View Code of Problem 107

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

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

	return 0;
}

Double click to view unformatted code.


Back to problem 107