This commit is contained in:
mr314ot 2025-10-16 13:04:11 +02:00
parent 6171013c42
commit 253ec0c3ff

View File

@ -72,8 +72,8 @@ int main(void) {
} else if (strlen(line) == 1 && strchr("+-*/", line[0])) { } else if (strlen(line) == 1 && strchr("+-*/", line[0])) {
//operacia //operacia
if (s.size < 2) { if (s.size < 2) {
printf("Chyba: nedostatok operandov.\n"); printf("not enough operands\n");
return 1; return 0;
} }
float b = pop_stack(&s); float b = pop_stack(&s);
float a = pop_stack(&s); float a = pop_stack(&s);
@ -91,7 +91,7 @@ int main(void) {
result = a / b; break; result = a / b; break;
default: default:
printf("Chyba: neznama operacia.\n"); printf("Chyba: neznama operacia.\n");
return 1; return 0;
} }
push_stack(&s, result); push_stack(&s, result);
} else { } else {