This commit is contained in:
Deinerovych 2024-10-16 10:10:09 +02:00
parent e99adaa6a4
commit 69f29b231d

View File

@ -69,7 +69,7 @@ int main() {
if (is_number(arr)) { if (is_number(arr)) {
float number = strtof(arr, &pend); float number = strtof(arr, &pend);
push(number); push(number);
printf("%.2f ", number); printf("%.2f\n", number);
} }
else if (is_operation(arr)) { else if (is_operation(arr)) {
if (stack_top < 1) { if (stack_top < 1) {
@ -82,7 +82,7 @@ int main() {
char operation = arr[0]; char operation = arr[0];
float result = calculator(n1, n2, operation); float result = calculator(n1, n2, operation);
push(result); push(result);
printf("%.2f ", result); printf("%.2f\n", result);
} }
else { else {
printf("no input\n"); printf("no input\n");
@ -91,9 +91,9 @@ int main() {
} }
if (stack_top == 0) { if (stack_top == 0) {
printf("\n%.2f\n", pop()); printf("%.2f\n", pop());
} else { } else {
printf("\nno input\n"); printf("no input\n");
} }
return 0; return 0;