View Code of Problem 86

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

Double click to view unformatted code.


Back to problem 86