View Code of Problem 86

#include <iostream>
using namespace std;

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

Double click to view unformatted code.


Back to problem 86