九度OJ 1009
来源:互联网 发布:群硕软件 编辑:程序博客网 时间:2024/05/24 23:12
#include <iostream>#include <string>using namespace std;int main(){ int n; while(cin >> n, n != 0) { string tree; cin >> tree; string root; root = tree[0]; string left; string right; for(int i = 1; i < tree.size(); ++i) { if(tree[i] > tree[0]) right += tree[i]; else left += tree[i]; } for(int i = 0; i < n; ++i) { string temp; cin >> temp; string a, b, r; r = temp[0]; for(int i = 1; i < temp.size(); ++i) { if(temp[i] > temp[0]) a += temp[i]; else b += temp[i]; } if(a == right && b == left && r == root) cout << "YES" << endl; else cout << "NO" << endl; } }}
0 0
- 九度OJ 1009
- 九度 oj 1009
- 【九度OJ】:九度OJ 1050
- 【九度OJ】:九度OJ 1053
- 【九度OJ】:九度OJ 1056
- 【九度OJ】:九度OJ 1059
- 【九度OJ】:九度OJ 1206
- 九度OJ 1009 二叉搜索树
- 九度oj-1009-二叉搜索树
- 九度oj 二叉排序树 1201,1009 c++
- 九度OJ - 1009 - 二叉搜索树
- 九度OJ 1009 二叉搜索树
- 九度OJ-1009-二叉搜索树
- 九度OJ 1009 二叉搜索树
- 九度OJ:1000
- 【九度OJ】 1006
- 九度 OJ 1499
- 九度OJ-1002
- [ZedBoard移植嵌入式Linux教程(7)]制作boot.bin
- 九度OJ 1008
- 2013 国家自然科学基金中标项目软件工程
- Android adb opendir failed ,permission denied
- 数据结构——二叉树
- 九度OJ 1009
- stm32多功能双向5v兼容的IO口的理解
- 记录使用ubuntu的一些经历
- 专利技术交底书撰写经历
- mobi格式文件解压实践
- iOS_本地化设置NSLocale
- hdu 5139 Formula
- 寻找指定元素的指针
- getWidth和getMeasuredWidth在何时可以得到正确数值