push
This commit is contained in:
parent
07cf460484
commit
b4f32aca5b
@ -42,7 +42,6 @@ int nacitaj_riadok(double* cislo) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
double horner(double* koeficienty, int pocet, double x) {
|
double horner(double* koeficienty, int pocet, double x) {
|
||||||
|
|
||||||
double vysledok = 0.0;
|
double vysledok = 0.0;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
@ -80,8 +79,8 @@ int main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (stav == -1) {
|
if (stav == -1) {
|
||||||
fprintf(stderr, "Chyba: Nepodarilo sa nacitat koeficient c. %d.\n", pocet + 1);
|
printf("Nepodarilo sa nacitat polynom na %d mieste.\n", pocet + 2);
|
||||||
return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
koeficienty[pocet] = koef;
|
koeficienty[pocet] = koef;
|
||||||
@ -89,12 +88,11 @@ int main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pocet == 0) {
|
if (pocet == 0) {
|
||||||
fprintf(stderr, "Chyba: Nepodarilo sa nacitat koeficient c. 1.\n");
|
printf("Nepodarilo sa nacitat polynom na 2 mieste.\n");
|
||||||
return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
double vysledok = horner(koeficienty, pocet, h);
|
double vysledok = horner(koeficienty, pocet, h);
|
||||||
|
|
||||||
printf("Vysledok je: %.2f\n", vysledok);
|
printf("Vysledok je: %.2f\n", vysledok);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user