diff --git a/cv3/program.c b/cv3/program.c index 642e552..64f60ae 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -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;