您的位置:首页 > 其它

简单的字符串匹配 poj1936

2013-01-05 23:27 423 查看
#include<iostream>
#include<string>
using namespace std;
int main()
{
char s[100005],t[100005];
int i,j,len1,len2;
while(scanf("%s %s",s,t)!=EOF)
{
len1=strlen(s);
len2=strlen(t);
i=0;
j=0;
while(i<len1 && j<len2)
{
if(s[i]==t[j])
{
i++;
j++;
}
else
{
j++;
}
}
if(i==len1)
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;

}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: