acgo题库
  • 首页
  • 题库
  • 学习
  • 竞赛
  • 讨论
  • 排行
  • 团队
  • 备赛专区

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
登录
注册
题目详情提交记录(0)
  • 又臭又长的一坨代码

    #include<bits/stdc++.h> using namespace std; int main(){ stack<int>st; string s; int n; cin>>n; while(n--){ cin>>s; if(s=="empty"){ if(st.empty()){cout<<"yes";} else{cout<<"no";} cout<<endl; } else if(s=="push"){ int m; cin>>m; st.push(m); } else if(s=="size"){cout<<"size = "<<st.size()<<endl;} else if(s=="top"){ if(st.empty()){cout<<"top fail";} else{cout<<"top = "<<st.top();} cout<<endl; } else if(s=="pop"){ if(st.empty()){cout<<"pop fail";} else{ cout<<"pop "<<st.top(); st.pop();} cout<<endl; } } return 0; } //速度前7% 内存前70% 真巧

    userId_undefined

    91封面我老师

    2阅读
    0回复
    0点赞
  • tj

    userId_undefined

    Tian

    出道萌新倔强青铜
    2阅读
    0回复
    0点赞

共22条

  • 1
  • 2
20条/页
跳至页
暂无数据

提交答案之后,这里将显示提交结果~

首页