From cc6d8d613262ecf03b25e8457ee5aa4e2b9e617d Mon Sep 17 00:00:00 2001 From: Weber Date: Mon, 14 Oct 2024 14:10:45 +0000 Subject: [PATCH] test --- cv3/program.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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;