View Code of Problem 107

#include "stdio.h"
#include "string.h"
void main()
{	
	int n,m;

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

Double click to view unformatted code.


Back to problem 107