View Code of Problem 86

#include<bits/stdc++.h>
using namespace std;

int main() {

	int n,a;
	cin>>a>>n;
	long long sum=0;
	int k=a;
	for(int i=1;i<=n;i++){
		sum+=a;
		a=a*10+k;
	} 
	cout<<sum<<endl;
	
	return 0;
}

Double click to view unformatted code.


Back to problem 86