This commit is contained in:
Weber 2024-10-14 13:42:28 +00:00
parent 95af0b465e
commit 7bab641ed7

View File

@ -91,15 +91,16 @@ int main() {
float hodnota;
char operacia;
if (sscanf(vstup, "%f", &hodnota) == 1) {
vloz(&kalkulacka, hodnota);
zobraz_zasobnik(&kalkulacka);
}
}
else if (sscanf(vstup, "%c", &operacia) == 1) {
if (!je_platna_operacia(operacia)) {
printf("bad input\n");
return 0;
continue;
}
switch (operacia) {
case '+':
@ -142,9 +143,10 @@ int main() {
break;
}
}
} else {
}
else {
printf("bad input\n");
return 0;
}
}