//백준 10828 - 스택#include #include #include using namespace std;int main(){ int n; cin >> n; // 명령 수 입력 stack stk; string command; int num; while(n--){ cin >> command;; if(command == "push"){ // 스택에 정수 넣기 cin >> num; stk.push(num); } else if(command == "top"){ // 스택의 가장 위에 있는 정수 출력 if(stk.empty()) // 스택에 들어있는 정수가 없는 경우 cout