Zero-complexity Transposition

Zero-complexity Transposition

https://www.nowcoder.com/practice/c54775799f634c72b447ef31eb36e975

#include <iostream>
#include <stack>
#include <cstdio>
using namespace std;

//大数要用lld
int main() {
    int n;
    stack<long long> stack;
    scanf("%d", &n);
    for(int i = 0; i < n; i++){
        long long num;
        scanf("%lld", &num);
        stack.push(num);
    }
    for(int i = 0; i < n; i++){
        printf("%lld ", stack.top());
        stack.pop();
    }
}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

2025-12-30 16:42
同济大学 C++
仁狂躁使者:哎呀,不用担心,我当时配环境配了两天,项目捋不清就问问导师能不能用ai,慢慢就清了,会好起来的
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
2025-12-03 11:33
能赢到发光发热​:我被平均了,谁给我补差价?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务