This commit is contained in:
Weber 2024-10-14 13:31:15 +00:00
parent 21e67c07dc
commit 97f559955f

View File

@ -97,11 +97,7 @@ int main() {
} }
} else if (sscanf(vstup, "%c", &operacia) == 1) { } else if (sscanf(vstup, "%c", &operacia) == 1) {
if (!je_platna_operacia(operacia)) { if (!je_platna_operacia(operacia)) {
if (kalkulacka.vrchol >= 0) { printf("bad input\n");
printf("%.2f\nbad input\n", kalkulacka.zasobnik[kalkulacka.vrchol]);
} else {
printf("bad input\n");
}
return 0; return 0;
} }
switch (operacia) { switch (operacia) {
@ -146,7 +142,7 @@ int main() {
} }
} }
} else { } else {
printf("no input\n"); printf("bad input\n");
return 0; return 0;
} }
} }