From cb93144809b34cb39e4ae0cb3844dbfd17d34dab Mon Sep 17 00:00:00 2001 From: Weber Date: Mon, 14 Oct 2024 13:15:02 +0000 Subject: [PATCH] test --- cv3/program.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/cv3/program.c b/cv3/program.c index 2d3d94d..6ab2e46 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -125,13 +125,21 @@ int main() { return 0; } break; - case '/': - if (!delit(&kalkulacka)) { - printf("division by zero\n"); - return 0; + case '/': { + float a, b; + if (vyber(&kalkulacka, &a, &b)) { + if (a == 0) { + printf("division by zero\n"); + return 0; + } else { + vloz(&kalkulacka, b / a); + zobraz_zasobnik(&kalkulacka); + printf("no input\n"); + return 0; + } } - zobraz_zasobnik(&kalkulacka); break; + } } } else { printf("no input\n");