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");