poj_1936 串
来源:互联网 发布:长袖连衣裙淘宝网秋季 编辑:程序博客网 时间:2024/06/05 07:22
水题。给定串s1,s2,看s2减去若干字符是否可以构成s1。
code:
<span style="font-size:18px;">#include <iostream>#include <fstream>using namespace std;int main(){//ifstream in("input.txt");char s1[100000], s2[100000];long i, j;while (cin >> s1 >> s2){long lens1 = strlen(s1);long lens2 = strlen(s2);i = 0;j = 0;while (true){if (i == lens1){cout << "Yes" << endl;break;}else if (i < lens1 && j == lens2){cout << "No" << endl;break;}if (s1[i] == s2[j]){i++;j++;}elsej++;}memset(s1,'\0',sizeof(s1));memset(s2,'\0',sizeof(s2));}//system("pause");return 0;}</span>
0 0
- poj_1936 串
- POJ_1936
- poj_1936 All in All(简单字符串)
- 串
- 串
- 串
- 串
- 串
- 串
- 串
- 串
- 串
- 串
- 串
- 串
- 串
- 串
- 串
- 创建自己的模块
- 安装usb摄像头驱动引起VMwareWorkstation9虚拟机无法正常打开
- extern “C”
- win32sdk学习-Richedit组件使用
- fragment跳转到Activity的错误,java.lang.IllegalStateException: No activity
- poj_1936 串
- 1130-host ... is not allowed to connect to this MySql server
- Windows下子类化目标窗口的方法
- 如何提取pdf文字
- Scala 类型
- 25、Reverse Nodes in k-Group
- 64位WIN7安装SourceInsight3.5汉化补丁或绿色汉化版显示序列号无效的问题与解决办法
- Mysql按条件计数的几种方法
- ITopologicalOperator接口