View Code of Problem 86

#include<stdio.h>
int main()
{
	int  a,n,i,j,sum=0,ten;
	scanf("%d %d",&a,&n);
	ten=a;
	for(i=1;i<=n;i++)
	{
		
		//printf("%d ",ten);
		if(i!=1) 
		ten=10*ten,a=ten+a;
		sum+=a;
	}
	printf("%d\n",sum);
}

Double click to view unformatted code.


Back to problem 86