View Code of Problem 107

#include<math.h>
#include<stdio.h>
#include<string.h>
int main()
{
	int m,n;
	int i,j,k;
	
while(scanf("%d %d",&m,&n)!=EOF)
{
	int a[10]={0};
	for(i=m;i<=n;i++)
	{
		k=i;
		while(k!=0)
		{
			j=k%10;
			a[j]++;
			k=k/10;
		}
	}
	for(i=0;i<10;i++)
	{
		printf("%d",a[i]);
		if(i!=9)
		{
			printf(" ");
		}
	}
	printf("\n");
 } 
}

Double click to view unformatted code.


Back to problem 107