View Code of Problem 86

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

Double click to view unformatted code.


Back to problem 86