Update 'cv3/program.c'
This commit is contained in:
parent
affd4a5ae5
commit
1369c121ed
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user