Want to try solving this problem? You can submit your code online if you log in or register.
Input File: stacksin.txt
Output File: stacksout.txt
Time limit: 1 seconds
You may assume that your stack does not grow beyond 100 levels deep.
Sample input:
1 2 3 p p 4 p p q
Sample output:
1 1 2 1 2 3 1 2 1 1 4 1 stack is empty!
Privacy
statement
© Australian Mathematics Trust 2001-2023
Page generated: 21 September 2023, 9:08pm AEST