#include <stdio.
h>
#include <stdbool.h>
#include <limits.h>
#define MAX 100
int st[MAX];
int top = -1; // -1 means empty
bool push(int x) {
if (top == MAX - 1) return false; // overflow
st[++top] = x;
return true;
}
int pop(void) {
if (top == -1) return INT_MIN; // underflow
return st[top--];
}
int peek(void) {
if (top == -1) return INT_MIN; // underflow
return st[top];
}
bool isEmpty(void) { return top == -1; }
int size(void) { return top + 1; }
int main(void) {
push(10); push(20);
printf("%d\n", peek()); // 20
printf("%d\n", pop()); // 20
printf("%d\n", pop()); // 10
printf("%d\n", pop()); // INT_MIN (empty)
}