du3 - 8
This commit is contained in:
parent
6171013c42
commit
253ec0c3ff
@ -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 {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user