题解 | #Zero-complexity

Zero-complexity Transposition

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

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

int main(){
    stack<long long> myStack;
    int n  ;
    long long num;
    scanf("%d",&n);
    for(int i = 0 ; i < n ; ++i){
        scanf("%lld",&num);
        myStack.push(num);
    }
    while(!myStack.empty()){
        printf("%lld ",myStack.top());
        myStack.pop();
    }
    printf("\n");
}

全部评论

相关推荐

评论
点赞
收藏
分享
牛客网
牛客企业服务