This commit is contained in:
Weber 2024-10-14 14:10:45 +00:00
parent c06a447948
commit cc6d8d6132

View File

@ -88,9 +88,7 @@ bool je_platne_cislo(const char *vstup) {
}
bool dost_operantov(KalkulackaZasobnik *kalkulacka) {
return kalkulacka->vrchol <= 1;
}
int main() {
KalkulackaZasobnik kalkulacka;
@ -112,10 +110,6 @@ int main() {
else if (strlen(vstup) == 2 && je_platna_operacia(vstup[0])) {
char operacia = vstup[0];
if (!dost_operantov(&kalkulacka)) {
printf("not enough operands\n");
return 0;
}
switch (operacia) {
case '+':
@ -152,6 +146,8 @@ int main() {
vloz(&kalkulacka, b / a);
zobraz_zasobnik(&kalkulacka);
}
default:
printf("not enough operands\n");
} else {
printf("no input\n");
return 0;