竞赛
考级
> 水题,反过来输出即可。 AC代码如上:
我是三发!!前面两个,这道题官方给的知识点明明是栈,为什么不用栈做 题解(用栈做)如下 #include<bits/stdc++.h> using namespace std; int main(){ stack<int>st; for(int i=1;;i++){ int x; cin>>x; if(x==0){ break; } st.push(x); } while(!st.empty()){ cout<<st.top()<<" "; st.pop(); } return 0; }
提交答案之后,这里将显示提交结果~