POJ 1936 All in All
来源:互联网 发布:我国银行员工待遇数据 编辑:程序博客网 时间:2024/06/07 02:10
比较水的题目,对两个字符串都进行一次遍历,看看能不能对应起来,比kmp要简单的多
#include <iostream>#include <cstdio>#include <memory.h>#include <string.h>using namespace std;#define maxn 100050int main(){ char str1[maxn],str2[maxn]; while(scanf("%s%s",&str1,&str2)!=EOF){ int loc1=0; int loc2=0; int len1 = strlen(str1); int len2 = strlen(str2); bool match = false; while(true){ if(loc1>=len1||loc2>=len2) break; if(str1[loc1]==str2[loc2]){ loc1++; loc2++; } else{ loc2++; } if(loc1==len1){ match=true; printf("Yes\n"); } } if(!match){ printf("No\n"); } }}
0 0
- poj 1936 "all in all"
- poj 1936 All in All
- POJ 1936 All in All
- poj 1936 All in All
- POJ 1936 all in all
- POJ 1936 All in All
- POJ 1936 All in All
- POJ 1936 All in All
- POJ-1936-All in All
- poj 1936 all in all
- poj 1936 All in All
- POJ 1936 All in ALL
- poj 1936 All in All
- poj 1936 All in All
- POJ 1936 All in All
- All in All(poj 1936)
- poj 1936 All in All
- poj 1936 All in All
- 如何跳转到另一个activity并且关闭当前的activity
- Hadoop IO 特性详解(1)【数据完整性】
- 时间序列算法的改善
- Leetcode 3 Longest Substring Without Repeating Characters
- Android Wear 开发入门
- POJ 1936 All in All
- 解决利用模板装linux网卡eth1问题
- 如何在ubuntu14.04中安装IE8
- 黑马程序员--C语言自学笔记---10字符串、指针
- LintCode 快速幂
- SQL语句大全
- scala学习总结之二
- chmod----改变一个或多个文件的存取模式(mode)
- 项目第四天