View Code of Problem 107

#include "stdio.h"
#include "math.h"
#include "string.h"

void main()
{
	int i,j,k;
	int a,b;

	for(;scanf("%d%d",&a,&b)!=EOF;)
	{	
		int s[100]={0};
		for(i=a;i<=b;i++)
		{
			k=i;
			for(;k>0;)
			{
				s[k%10]++;
				k=k/10;
			}
		}
		for(i=0;i<10;i++)
		{
			if(i+1==10)
				printf("%d",s[i]);
			else
				printf("%d ",s[i]);
		}
		printf("\n");
	}
}

Double click to view unformatted code.


Back to problem 107