2 条题解

  • 0
    @ 2026-8-27 17:01:16

    使用STL自带的 即可

    AC code:

    #include <bits/stdc++.h>
    using namespace std;
    stack <int>st;
    
    
    int main() {
    	int n;
    	cin>>n;
    	while(n--){
    		int x;
    		cin>>x;
    		st.push(x);
    	}
    	while(!st.empty()){
    		cout<<st.top()<<' ';
    		st.pop();
    	}
    
    
    	return 0;
    }
    

    信息

    ID
    30013
    时间
    1000ms
    内存
    256MiB
    难度
    1
    标签
    递交数
    70
    已通过
    49
    上传者