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 |
纯java思想c++选手飘过 string iterator#include <iostream> #include <string> using namespace std; string s; string t; string::iterator sIter,tIter; void sub(){ int sLength=s.length(); int tLength = t.length(); for(sIter = s.begin(),tIter = t.begin();sIter!=s.end()&&tIter!=t.end();){ if(*sIter == *tIter){ sIter++; tIter++; } else{ tIter++; } } if(sIter==s.end()){ cout<<"Yes"<<endl; } else cout<<"No"<<endl; } int main(){ while(cin>>s>>t){ sub(); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator