Схема Горнера
C++ Алгоритми
обчислення многочлена
Блок-схема за ДСТУ
Вихідний код
double horner(double a[], int n, double x) {
double res = a[0];
for (int i = 1; i < n; i++) {
res = res * x + a[i];
}
return res;
} обчислення многочлена
double horner(double a[], int n, double x) {
double res = a[0];
for (int i = 1; i < n; i++) {
res = res * x + a[i];
}
return res;
}