用一个栈实现另一个栈的排序
https://www.nowcoder.com/practice/ff8cba64e7894c5582deafa54cca8ff2?tpId=101&tqId=33081&rp=1&ru=/exam/oj/ta&qru=/exam/oj/ta&sourceUrl=%2Fexam%2Foj%2Fta%3Fdifficulty%3D1%26page%3D1%26pageSize%3D50%26search%3D%26tpId%3D101%26type%3D101&difficulty=1&judgeStatus=undefined&tags=&title=
若stk1为升序则插入stk1,否则将stk1的top插入到stk2,并将stk1的top弹出,直到将所有比当前元素大的元素弹出stk1,将当前元素插入stk1,并将stk2中的元素依次插入stk1
for (int i = 0; i < n; i ++)
{
int x;
cin >> x;
while (t1 > 0 && x < stk1[t1]) stk2[++ t2] = stk1[t1 --];
stk1[++ t1] = x;
while (t2 > 0) stk1[++ t1] = stk2[t2 --];
}
while (t1 > 0) cout << stk1[t1 --] << ' ';