cv3 cv3 cv3

This commit is contained in:
Ivan Leichenko 2024-10-14 15:50:48 +02:00
parent 6324b6bf2f
commit 448b98b879

View File

@ -107,12 +107,13 @@ int main(int argc, char const *argv[])
} }
else else
{ {
if(calculate(&calc_stack, buf[0]) == 1) int calc_code = calculate(&calc_stack, buf[0]);
if(calc_code == 1)
{ {
printf("division by zero\n"); printf("division by zero\n");
return 0; return 0;
} }
else if(calculate(&calc_stack, buf[0]) == 2) else if(calc_code == 2)
{ {
printf("not enough operands\n"); printf("not enough operands\n");
return 0; return 0;