Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
哪位牛人帮忙看一下,感激涕泠#include<iostream> #include<string> using namespace std; int main() { string s1,s2; while(cin>>s1>>s2) { int k=0,j=0; int len1 =s1.length(); int len2 = s2.length(); for(int i =0;i<len1;i++) for(;j<len2;j++) if(s1[i]==s2[j]) { k++; if(k==len1) { cout<<"Yes"<<endl;goto End; } break; } else if(j==len2-1) { cout<<"No"<<endl; goto End; } else continue; End: continue; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator