标签:
#include<iostream> #include<string> using namespace std; int main() { //freopen("acm.acm","r",stdin); string s1; string s2; int len_1; int len_2; int i; int j; int index; while(cin>>s1>>s2) { // cout<<s1<<endl; // cout<<s2<<endl; len_1 = s1.length(); len_2 = s2.length(); index = 0; for(i = 0; i < len_1; ++ i) { for(j = index; j < len_2; ++ j) { if(s1[i] == s2[j]) { index = j+1; break; } } if(j == len_2) { break; } } if(i == len_1) { cout<<"Yes"<<endl; } else { cout<<"No"<<endl; } } }
标签:
原文地址:http://www.cnblogs.com/gavinsp/p/4566584.html