COJ 1151 STL中的stack每日一水
来源:互联网 发布:自学java工作 知乎 编辑:程序博客网 时间:2024/06/03 02:33
X则入栈,Y则出栈,判断到最后一个字母时是不是为空,非空输出Joopoo,空输出pzjay.
#include <iostream>#include <map>#include <deque>#include <queue>#include <stack>#include <string>#include <cstring>#include <cstdio>#include <cmath>#include <algorithm>#include <map>#include <set>using namespace std;int main(){ stack<char>p; int i=1,l; string a; cin>>a; if(a[0]=='Y') {cout<<"Joopoo"<<endl;return 0;} l=a.length(); p.push(a[0]); while(i<l) { if(p.empty()==true&&a[i]=='Y') break; else if(!p.empty()&&a[i]=='Y') p.pop(); else p.push(a[i]); i++; } if(i==l&&p.empty()==true) cout<<"Pzjay"<<endl; else cout<<"Joopoo"<<endl; return 0;}
- COJ 1151 STL中的stack每日一水
- COJ 1236 STL中的map每日二水
- COJ 1373 STL中的map每日四水
- COJ 1285 STL中的map每日三水(无限个输入按哪个快捷键得输出)
- COJ 1383 STL中的set
- STL中的Stack
- c++stl中的stack
- STL中的stack的应用
- STL中的queue和stack
- 关于STL中的堆栈Stack
- C++ STL(一)STACK &&queue
- c++之stl中的stack用法总结
- STL中的stack详解及其自我实现
- 使用Vector模拟实现STL中的stack
- STL stack
- stl stack
- STL stack
- stl stack
- 字符串转换为对象,然后对象转换为json串
- Spring Batch之XML文件操作
- oracle 记录被另一个用户锁住
- ACE+gSOAP实现高性能WebService Server(C/C++)
- 基于Flex的三维实景地图组件 HMap V3.0已经发布,并在项目中应用
- COJ 1151 STL中的stack每日一水
- Ubuntu12.04 设置root账号
- 使用nextInt()等接受输入时必须注意换行符的输入
- 设置表格每行的单元格的过滤条件都不同
- 给初学编程解题没思路的学生的建议
- poj 3304 判断直线与线段相交
- 异常处理
- Fedora 15 KDE中如何打开software management及如何应用
- Windows Server 2008 R2远程桌面服务配置和授权激活