View Code of Problem 86

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

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

Double click to view unformatted code.


Back to problem 86