commit
This commit is contained in:
parent
b21c094531
commit
6ebca183a1
@ -1,3 +1,4 @@
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@ -14,7 +15,6 @@ struct stack{
|
||||
void print_stack(struct stack* stack);
|
||||
void push_stack(struct stack* stack, float value);
|
||||
float pop_stack(struct stack* stack);
|
||||
int count_stack(struct stack* stack);
|
||||
|
||||
|
||||
|
||||
@ -74,8 +74,9 @@ int main(){
|
||||
print_stack(&myStack);
|
||||
printf("\n");
|
||||
}
|
||||
} else {
|
||||
} else if(isdigit(char_value[0]) != 0 ){
|
||||
float_value = strtof(char_value, NULL);
|
||||
//printf("float value: %f\n",float_value);
|
||||
if(float_value == 0){
|
||||
puts("bad input");
|
||||
break;
|
||||
@ -85,6 +86,9 @@ int main(){
|
||||
printf("\n");
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
puts("bad input");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
//push_stack(&myStack, float_value);
|
||||
|
Loading…
Reference in New Issue
Block a user