版本比较
数据结构
正文
增加 5 行删除 5 行
37 行未改动38394041424344454633 行未改动80818283848586878877 行未改动166167168169170171172173174817 行未改动全部展开992993994995996997998999100010011002100310041005155 行未改动全部展开37 行未改动}else if(op==3)cout<<top<<"\n";//栈的大小else cout<<sta[top]<<"\n";//输出栈顶}return 0;}```##### STL 实现33 行未改动}else if(op==3)cout<<sta.size()<<"\n";else cout<<sta.top()<<"\n";}return 0;}```#### 例题77 行未改动{q.push(d);}if(s[i]=='.') continue;if(s[i]=='+'){int a=q.top();q.pop();int b=q.top();q.pop();q.push(a+b);817 行未改动全部展开cin>>x>>y;a[y]=a[x];a[x]=y;}//将元素y插入到x后面else if(it==2){cin>>x;cout<<a[x]<<endl;}//询问x后面的元素是什么。else if(it==3){cin>>x;a[x]=a[a[x]];}//从表中删除元素x后面的那个元素。155 行未改动全部展开37 行未改动38394041424344454633 行未改动80818283848586878877 行未改动166167168169170171172173174817 行未改动全部展开992993994995996997998999100010011002100310041005155 行未改动全部展开37 行未改动}else if(op==3)cout<<top<<"\n";//栈的大小else cout<<sta[top]<<"\n";//输出栈顶}return 0;}```##### STL 实现33 行未改动}else if(op==3)cout<<sta.size()<<"\n";else cout<<sta.top()<<"\n";}return 0;}```#### 例题77 行未改动{q.push(d);}if(s[i]=='.') continue;if(s[i]=='+'){int a=q.top();q.pop();int b=q.top();q.pop();q.push(a+b);817 行未改动全部展开cin>>x>>y;a[y]=a[x];a[x]=y;}//将元素y插入到x后面else if(it==2){cin>>x;cout<<a[x]<<endl;}//询问x后面的元素是什么。else if(it==3){cin>>x;a[x]=a[a[x]];}//从表中删除元素x后面的那个元素。155 行未改动全部展开