This commit is contained in:
Weber 2024-10-14 13:15:02 +00:00
parent 94b2f80db7
commit cb93144809

View File

@ -125,13 +125,21 @@ int main() {
return 0; return 0;
} }
break; break;
case '/': case '/': {
if (!delit(&kalkulacka)) { float a, b;
printf("division by zero\n"); if (vyber(&kalkulacka, &a, &b)) {
return 0; 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; break;
}
} }
} else { } else {
printf("no input\n"); printf("no input\n");