版本比较
xiaokeai2013
个人介绍
增加 59 行删除 1 行
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455567575859606172 行未改动134135136137138139140141142143144145146147148149169 行未改动全部展开⎛⎝≥⏝⏝≤⎛⎝ฏ๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎.҉ོ꧂ฏ๎็็็็
```#include<bits/stdc++.h>#define int unsigned long longusing namespace std;stack<int> s;int n,t;string a;int x;void solve(){ while(!s.empty()) s.pop(); cin>>n; for(int i=1;i<=n;i++) { cin>>a; if(a=="push") { cin>>x; s.push(x); } else if(a=="pop") { if(s.size()==0) cout<<"Empty"<<endl; else s.pop(); } else if(a=="query") { if(s.size()==0) cout<<"Anguei!"<<endl; else cout<<s.top()<<endl; } else if(a=="size") { int len=s.size(); cout<<len<<endl; } } return;}signed main(){ cin>>t; while(t--) { solve(); } return 0;}```
123编程网址: https://cppoj.kids123code.com/
CSP-J2026公益课用户名1:xingshiyu
CSP-J2026公益课密码1:code123 CSP-J2026公益课密码1:keaixiao2016YU
CSP-J2026公益课用户名2:xingshiyu26
CSP-J2026公益课密码2:Code@12372 行未改动|
|
https://www.douyin.com/user/MS4wLjABAAAAn4DYJzGFqFISKxc4_zWgFiBzEKYRuLcYk0FE0L73ViE?from_tab_name=main&modal_id=7701941647050804518&relation=0&vid=7701944098386644264
https://www.cnfak.com/xxgk/235488-1-1.html
https://v.qq.com/x/cover/mzc003372o49pi8/i33732rubt7.html
https://cn.pigame.cc/game/haunted-dorm
https://www.uukan.org/chapter/pdaPb6djsVQEpz12p7Ymv.html
https://www.mopbook.com/book/HLYI.html
169 行未改动全部展开