View Code of Problem 86

#include<stdio.h>
int main()
{
	int a,n;
	scanf("%d %d",&a,&n);
	int x=a;
	int t=1;
	int sum=0;
	while(n>0)
	{
		sum+=x; 
		t=t*10;
		x=a*t+x;
		n--;
	}
	printf("%d\n",sum);
	return 0;
}

Double click to view unformatted code.


Back to problem 86