2025-02-22 12:56:22 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#define maxcoe 100
|
|
|
|
|
|
|
|
int read_number (double *num) {
|
2025-02-22 12:57:04 +00:00
|
|
|
char buffer[50];
|
|
|
|
if (!fgets(buffer, sizeof(buffer), stdin)) { //если fgets не смог считать строку
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2025-02-22 13:16:17 +00:00
|
|
|
if (sscanf(buffer, "%lf", num) ! = 1) { //переделываем в double. Если всё успешно
|
2025-02-22 13:16:02 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2025-02-22 13:16:17 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2025-02-22 13:25:14 +00:00
|
|
|
double hornerovaschema (double x, double cofecients[], int count) { //вычесляет значение многочлена в точке x
|
2025-02-22 13:16:17 +00:00
|
|
|
double result = 0.0;
|
|
|
|
for (int i = 0; i < count; i++) {
|
|
|
|
result = result * x + coefficients[i];
|
|
|
|
}
|
2025-02-22 13:25:14 +00:00
|
|
|
return result;
|
2025-02-22 12:56:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int main() {
|
2025-02-22 13:25:14 +00:00
|
|
|
|
2025-02-22 12:56:22 +00:00
|
|
|
return 0;
|
|
|
|
}
|