/* * ISA 563, Spring 2011 * Copyleft by Muhammad Abdulla */ #include #include #include "stack2.h" #define MAXLINE 32 int main ( int argc, char *argv[] ) { int i; char line[MAXLINE]; fprintf(stdout, "Please enter numbers to stacked:\n"); while ( fgets(line, sizeof(line), stdin) ) { i = atoi(line); if ( ! stack_full() ) { stack_push(i); } } while ( ! stack_empty() ) { fprintf(stdout, "%d\n", stack_pop()); } return 0; }