스택은 선형데이터 구조로 LIFO(Last In First Out)의 형태를 나타냅니다. 데이터를 입력할 때는 Push, 꺼낼 때는 Pop이라고 합니다. #include #include #define MAX_SIZE 100 // Stack structure struct Stack { int data[MAX_SIZE]; int top; }; // Initialize stack void init(struct Stack *s) { s->top = -1; } // Push element to stack void push(struct Stack *s, int x) { if (s->top == MAX_SIZE - 1) { printf("Error: stack overflow\n"); return; } s->data..