Browse Source

Update 'cv3/program.c'

master
Tamáš 2 months ago
parent
commit
9cee0d1287
  1. 6
      cv3/program.c

6
cv3/program.c

@ -19,15 +19,14 @@ int main() {
double coefficients[MAX_COEFFICIENTS];
int count = 0;
printf("Enter the value of x: ");
fgets(buffer, BUFFER_SIZE, stdin);
if (sscanf(buffer, "%lf", &x) != 1) {
printf("Nepodarilo sa nacitat zaklad x\n");
return 0;
}
printf("Enter coefficients from highest to lowest degree, finish with an empty line:\n");
while (fgets(buffer, BUFFER_SIZE, stdin) && buffer[0] != '\n') {
if (sscanf(buffer, "%lf", &coef) == 1) {
coefficients[count++] = coef;
@ -46,3 +45,4 @@ int main() {
return 0;
}

Loading…
Cancel
Save