1037 - [Data Structure] Stacks & Queues Scoreboard

Time

2016/10/26 18:30:00 2016/10/26 19:30:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
11130 Stack

11130 - Stack   

Description

Please implement the three basic stack operations.

Input

There are 3 kinds of stack operations(<50000) in the input, including
"push i": Push i on the stack, where i is an integer.
"pop": Pop the stack. Do nothing when the stack is empty.
"top": Output the top of the stack. Output "X" when the stack is empty.

Output

When a top operation is executed, output the top value of the stack.

Sample Input  Download

Sample Output  Download

Tags




Discuss