9
This commit is contained in:
parent
18ecde9c5b
commit
016c07efb5
@ -11,7 +11,7 @@ int stack_top = -1;
|
|||||||
bool is_number(char *string) {
|
bool is_number(char *string) {
|
||||||
char *end;
|
char *end;
|
||||||
strtof(string, &end);
|
strtof(string, &end);
|
||||||
return end != string && *end == '\n';
|
return end != string && (*end == '\n' || *end == '\0');
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_operation(char *string) {
|
bool is_operation(char *string) {
|
||||||
@ -99,6 +99,9 @@ int main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (stack_top == 0) {
|
if (stack_top == 0) {
|
||||||
|
if (!first_output) {
|
||||||
|
printf(" ");
|
||||||
|
}
|
||||||
printf("\n%.2f\n", pop());
|
printf("\n%.2f\n", pop());
|
||||||
} else {
|
} else {
|
||||||
printf("\nno input\n");
|
printf("\nno input\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user