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 |
30A 纪念 附代码#include <string> #include <iostream> #include <cstdio> #include <memory.h> using namespace std; bool findsub(string a,string b) { if(a.size()>b.size()) return false; else { int loc=-1; for(int i=0;i<a.size();i++) { loc=b.find(a[i],loc+1); if(loc==string::npos) return false; } return true; } } int main() { //freopen("d:\\in.txt","r",stdin); //freopen("d:\\out.txt","w",stdout); string a,b; a.resize(100000); b.resize(100000); while(cin>>a>>b) { if(findsub(a,b)) cout<<"Yes"<<endl; else cout<<"No"<<endl; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator