View Code of Problem 86

#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;

int main()
{
	int num;
	int count;
	long long sum=0;
	cin >> num >> count;
	for (int i = 0; i < count; i++) {
		sum = sum+(count-i)*(num * pow(10, i));
	}
	cout << sum;
	return 0;
}
/*
Main.cc: In function 'int main()':
Main.cc:15:30: error: 'pow' was not declared in this scope
   sum = sum+(count-i)*(num * pow(10, i));
                              ^~~
Main.cc:15:30: note: suggested alternative: 'putw'
   sum = sum+(count-i)*(num * pow(10, i));
                              ^~~
                              putw
*/

Double click to view unformatted code.


Back to problem 86