| 6 | cin.tie(0); \ |
| 7 | cout.tie(0); |
| 8 | void insertatbottom(stack<int> &st, int ele) |
| 9 | { |
| 10 | if (st.empty()) |
| 11 | { |
| 12 | st.push(ele); |
| 13 | return; |
| 14 | } |
| 15 | |
| 16 | int topele = st.top(); |
| 17 | st.pop(); |
| 18 | insertatbottom(st, ele); |
| 19 | st.push(topele); |
| 20 | } |
| 21 | void reverse(stack<int> &st) |
| 22 | { |
| 23 | if (st.empty()) |