View Code of Problem 86

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

Double click to view unformatted code.


Back to problem 86