Aktualizovat du2/program.c
This commit is contained in:
parent
7175185945
commit
420615385e
@ -14,9 +14,9 @@ double citaj_cislo(int poradie) {
|
|||||||
char buffer[100];
|
char buffer[100];
|
||||||
if (fgets(buffer, sizeof(buffer), stdin) == NULL) {
|
if (fgets(buffer, sizeof(buffer), stdin) == NULL) {
|
||||||
if (poradie == 0) {
|
if (poradie == 0) {
|
||||||
fprintf(stderr, "Chyba: Nepodarilo sa nacitat hodnotu x.\n");
|
printf("Chyba: Nepodarilo sa nacitat hodnotu x.\n");
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Nepodarilo sa nacitat polynom na %d mieste.\n", poradie);
|
printf("Nepodarilo sa nacitat polynom na %d mieste.\n", poradie);
|
||||||
}
|
}
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -30,9 +30,9 @@ double citaj_cislo(int poradie) {
|
|||||||
|
|
||||||
if (!je_cislo(buffer)) {
|
if (!je_cislo(buffer)) {
|
||||||
if (poradie == 0) {
|
if (poradie == 0) {
|
||||||
fprintf(stderr, "Chyba: Nepodarilo sa nacitat hodnotu x.\n");
|
printf("Chyba: Nepodarilo sa nacitat hodnotu x.\n");
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Nepodarilo sa nacitat polynom na %d mieste.\n", poradie);
|
printf("Nepodarilo sa nacitat polynom na %d mieste.\n", poradie);
|
||||||
}
|
}
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -63,13 +63,13 @@ int main() {
|
|||||||
koef[n++] = koeficient;
|
koef[n++] = koeficient;
|
||||||
|
|
||||||
if (n >= 100) {
|
if (n >= 100) {
|
||||||
fprintf(stderr, "Chyba: Prilis vela koeficientov.\n");
|
printf("Chyba: Prilis vela koeficientov.\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n == 0) {
|
if (n == 0) {
|
||||||
fprintf(stderr, "Chyba: Neboli zadane ziadne koeficienty.\n");
|
printf("Chyba: Neboli zadane ziadne koeficienty.\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user