View Code of Problem 107

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

Double click to view unformatted code.


Back to problem 107