From 6d6c76eb61760ef5626b548f99863efc6319b978 Mon Sep 17 00:00:00 2001 From: Weber Date: Mon, 14 Oct 2024 13:44:34 +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 2b6f8b8..8967a87 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -91,16 +91,14 @@ int main() { float hodnota; char operacia; - if (sscanf(vstup, "%f", &hodnota) == 1) { vloz(&kalkulacka, hodnota); - zobraz_zasobnik(&kalkulacka); + printf("%.2f\n", hodnota); // Vypíšeme platné číslo } - else if (sscanf(vstup, "%c", &operacia) == 1) { if (!je_platna_operacia(operacia)) { printf("bad input\n"); - continue; + continue; // Preskočí ďalšie iterácie cyklu } switch (operacia) { case '+': @@ -143,9 +141,7 @@ int main() { break; } } - } - - else { + } else { printf("bad input\n"); } }