This commit is contained in:
Weber 2024-10-14 12:50:24 +00:00
parent 445f8f07e5
commit 2b1d9e648b

View File

@ -114,13 +114,20 @@ int main() {
printf("no input\n"); printf("no input\n");
} }
break; break;
case '/': case '/': {
if (!delit(&kalkulacka)) { float a, b;
printf("division by zero\n"); if (vyber(&kalkulacka, &a, &b)) {
if (a == 0) {
printf("division by zero\n");
} else {
vloz(&kalkulacka, b / a);
zobraz_zasobnik(&kalkulacka);
}
} else { } else {
zobraz_zasobnik(&kalkulacka); printf("no input\n");
} }
break; break;
}
default: default:
printf("no input\n"); printf("no input\n");
return 0; return 0;