View Code of Problem 86

#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	int n, m;
	cin >> n >> m;
	int k = n;
	long long int res = 0;
	for(int i = 1;i <= m;i ++)
	{
		res += n;
		n = n*10 + k;
	}
	cout << res << endl;
	return 0;
}

Double click to view unformatted code.


Back to problem 86