摘要: ACboy needs your help again! 思路:分两种容器,一个先进先出,一个先进后出,显然一个队列,一个栈,分好情况就行 代码: #include<iostream> #include<queue> #include<stack> using namespace std; int 阅读全文
posted @ 2020-02-23 15:08 PCDL&TIPO 阅读(199) 评论(0) 推荐(0) 编辑
摘要: Text Reverse 思路:这道题就是一个字符串反转的问题,可以考虑使用栈的性质,先进后出,来完成这道题 代码: #include<iostream> #include<stack> using namespace std; int main(){ int n; char ch; while ( 阅读全文
posted @ 2020-02-23 15:05 PCDL&TIPO 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 圆桌问题 思路:其实这道题用vector容器会大大方便很多,但是还是选择了使用while循环,走while循环的话,只需要注意圆桌就行了 代码: #include<iostream> #include<cstring> using namespace std; int main(){ int a[1 阅读全文
posted @ 2020-02-23 15:00 PCDL&TIPO 阅读(193) 评论(0) 推荐(0) 编辑