View Code of Problem 86

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

Double click to view unformatted code.


Back to problem 86