#include <iostream>
int main()
{
double a[10], x, y = 0;
std::cout << "Vecror a: ";
for (int i = 0; i < 10; i++)
std::cin >> a[i];
std::cout << "x: ";
std::cin >> x;
for (int i = 1; i <= 10; i++)
y += (i % 2 == 0 ? (-1) : 1) * (a[i-1]) * (pow(x,i+1));
std::cout << "y: " << y;
return 0;
}
#include <iostream>
int main()
{
double a[10], x, y = 0;
std::cout << "Vecror a: ";
for (int i = 0; i < 10; i++)
std::cin >> a[i];
std::cout << "x: ";
std::cin >> x;
for (int i = 1; i <= 10; i++)
y += (i % 2 == 0 ? (-1) : 1) * (a[i-1]) * (pow(x,i+1));
std::cout << "y: " << y;
return 0;
}