#include #include #include #include #include #define LINE_SIZE 100 #define STACK_SIZE 100 struct stack{ float values[LINE_SIZE]; int size; }; void print_stack(struct stack* stack){ for (int i = 0; i < stack->size; i++){ printf("%.0f", stack->values[i]); } printf("\n"); } int main(){ char input[LINE_SIZE]; float y; struct stack mystack; memset(&mystack, 0, sizeof(struct stack)); while(fgets(input, LINE_SIZE, stdin) != NULL){ input[strlen(input - 1)] = '\0'; if(sscanf(input, "\f", &y) == 1){ printf("Success!\n"); assert(mystack.size < STACK_SIZE); mystack.values[mystack.size] = y; mystack.size ++; } else{ return 1; } print_stack(&mystack); } return 0; }