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;
}
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");