2024-02-29 13:23:40 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#define SIZE 10
|
|
|
|
|
|
|
|
int main() {
|
2024-03-04 13:14:10 +00:00
|
|
|
int coefs[SIZE];
|
2024-02-29 13:23:40 +00:00
|
|
|
int x = 0;
|
2024-03-04 12:55:19 +00:00
|
|
|
int input;
|
2024-02-29 13:23:40 +00:00
|
|
|
int count = 0;
|
2024-03-04 13:14:10 +00:00
|
|
|
int length;
|
|
|
|
int result = 0;
|
2024-03-04 12:55:19 +00:00
|
|
|
|
2024-03-04 13:02:52 +00:00
|
|
|
while (count < SIZE && scanf("%d", &input) == 1) {
|
|
|
|
coefs[count] = input;
|
|
|
|
count++;
|
|
|
|
}
|
2024-03-04 12:55:19 +00:00
|
|
|
|
2024-03-04 13:14:10 +00:00
|
|
|
length = count;
|
|
|
|
|
|
|
|
for (int i = length - 1; i >= 0; i--) {
|
|
|
|
result += coefs[0] * coefs[i];
|
|
|
|
}
|
|
|
|
|
2024-03-04 13:02:52 +00:00
|
|
|
printf("Coefficients: ");
|
|
|
|
for (int i = 0; i < count; i++) {
|
|
|
|
printf("%d ", coefs[i]);
|
|
|
|
}
|
2024-03-04 13:14:10 +00:00
|
|
|
printf("\nResult: %d\n", result);
|
2024-02-29 13:23:40 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2024-03-04 13:02:52 +00:00
|
|
|
|
2024-03-04 13:14:10 +00:00
|
|
|
|