#include <iostream>
using namespace std;
int main()
{
int n;
double x, a, p;
cin >> n;
cin >> x;
cin >> a;
p = a;
for (int i=n; i>0; i--) {
cin >> a;
p *= x;
p += a;
}
cout << "The value of the polynom is " << p << endl;
return 0;
}
Comments
Leave a comment