简单
2025-08-04 15:18:54
发布于:上海
0阅读
0回复
0点赞
#include<iostream>
#include<stack>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
stack<int>a;
int k;
while(1)
{
cin>>k;
if(k==0)
{
break;
}
a.push(k);
}
while(!a.empty())
{
k=a.top();
cout<<k<<" ";
a.pop();
}
return 0;
}
这里空空如也
有帮助,赞一个