View Code of Problem 86

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main (){
	int a, n;
	scanf("%d%d", &a, &n);
	int sum = 0, t = 0;
	for(int i = 0;i < n;i++){
		t = t*10+a;
		sum += t;
	}
	printf("%d\n",sum);

	return 0;
}

Double click to view unformatted code.


Back to problem 86