Introduction - If you have any usage issues, please Google them yourself
Task description
Both stack and queue provide push / pop operations, in which push: adds an element. Pop: pop an element. Give a linear structure in and out order, determine whether the structure is stack or queue.
Enter a description
In the first line, enter an integer s to represent the s set of test data.
For each set of test data, enter an integer n in the first line to represent the number of operations. Then enter n lines, each containing two integers type val. When type = 1, it indicates that the operation is a push operation, and val represents the number entered. When type = 2, it indicates that the operation is a pop operation, and val represents the number.