题解 |栈操作 c++
Zero-complexity Transposition
https://www.nowcoder.com/practice/c54775799f634c72b447ef31eb36e975
#include <bits/stdc++.h> using namespace std; int main() { int n; stack <long long> s; long long x; cin>>n; for(int i=0;i<n;i++){ cin>>x; s.push(x); } while(!s.empty()){ cout<<s.top()<<" "; s.pop(); } }