From 016c07efb595e6a8bf3140c8ed054bdafd2918e1 Mon Sep 17 00:00:00 2001 From: Deinerovych Date: Wed, 16 Oct 2024 10:28:05 +0200 Subject: [PATCH] 9 --- cv3/program.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cv3/program.c b/cv3/program.c index b09865c..c6da872 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -11,7 +11,7 @@ int stack_top = -1; bool is_number(char *string) { char *end; strtof(string, &end); - return end != string && *end == '\n'; + return end != string && (*end == '\n' || *end == '\0'); } bool is_operation(char *string) { @@ -99,6 +99,9 @@ int main() { } if (stack_top == 0) { + if (!first_output) { + printf(" "); + } printf("\n%.2f\n", pop()); } else { printf("\nno input\n");