Update 'cv3/program.c'

This commit is contained in:
Tamáš 2024-03-08 08:23:26 +00:00
parent affd4a5ae5
commit 1369c121ed

View File

@ -15,18 +15,9 @@ int main() {
double coefficients[MAX_COEFFICIENTS];
int count = 0;
printf("Enter the value of x: ");
if (scanf("%lf", &x) != 1) {
printf("Invalid input for x.\n");
return 1;
}
scanf("%lf", &x);
printf("Enter coefficients from highest to lowest degree, finish with an empty line:\n");
while (scanf("%lf", &coef) == 1) {
if (count >= MAX_COEFFICIENTS) {
printf("Maximum number of coefficients exceeded.\n");
return 1;
}
coefficients[count++] = coef;
}