#include <iostream>
#include <string>
using namespace std;
bool issubsequence(string str1,string str2){
int length1=str1.length(),length2=str2.length();
int j=0,i=0;
for(;i<length1;i++,j++){
while(j<length2 && str1[i] != str2[j])
j++;
if(j==length2)
break;
}
if(i == length1)
return true;
else
return false;
}
int main(){
string str1,str2;
while(cin>>str1>>str2){
if(issubsequence(str1,str2))
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
}
return 0;
}
poj 1936 all in all
最新推荐文章于 2018-09-14 06:39:34 发布