From f04f75c1ac62c1c735c75dccc330e6c3cd6c1244 Mon Sep 17 00:00:00 2001 From: Ivan Leichenko Date: Mon, 14 Oct 2024 14:24:03 +0200 Subject: [PATCH] update cv3 --- cv3/program.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cv3/program.c b/cv3/program.c index 2e129db..9cf2e87 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -39,13 +39,13 @@ float calculate(struct stack* stack, char operator) res = num1+num2; break; case '-': - res = num1-num2; + res = num2-num1; break; case '*': res = num1*num2; break; case '/': - res = num1/num2; + res = num2/num1; break; } add(stack, res); @@ -80,7 +80,7 @@ int main(int argc, char const *argv[]) } for (int i = 0; i < calc_stack.size; i++) { - printf("%0.f ", calc_stack.values[i]); + printf("%2.f ", calc_stack.values[i]); } printf("\n"); }