题目链接:http://poj.org/problem?id=1936
这题很水,留个足迹
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
#define maxn 100010
char first[maxn],second[maxn];
bool find_ans()
{
int i,j,k;
j=0;
for(i=0;first[i]&&second[j];i++)
{
while(second[j]!=first[i] && second[j])
{
j++;
}
if(second[j]==0)
return false;
else
j++;
}
return true;
}
int main()
{
while(scanf("%s%s",first,second)!=EOF)
{
if(find_ans())
printf("Yes\n");
else
printf("No\n");
}
return 0;
}
本文提供了解决POJ在线评测平台第1936题的详细代码实现步骤,通过字符串匹配算法高效求解,适合初学者理解和实践。
4761

被折叠的 条评论
为什么被折叠?



