题解 | #Zero-complexity Trans#
Zero-complexity Transposition
https://www.nowcoder.com/practice/c54775799f634c72b447ef31eb36e975
#include<iostream> #include<stack> using namespace std; int main() { int n; scanf("%d", &n); stack<long long int> number; long long int tmp; for (int i = 0; i < n; i++) { scanf("%lld", &tmp); number.push(tmp); } for (int i = 0; i < n; i++) { printf("%lld ", number.top()); number.pop(); } printf("\n"); } //要注意long long的输入格式 //其在Windows系统下为scanf("%I64d",), //在Linux系统下为scanf("%lld", //具体用哪种格式,需要取决于考试评测系统 //如果怕出现问题,那么可以用!!!!!!C++的cin进行输入!!! //它无视系统的差异。
- 注意数据范围要用long long int;一般的环境int 和 long int没有区别
- 注意输入,不同的评测系统可能用法不一样,要试好
- 如果怕出问题可以用cin