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 |
SOS! 谁给点BT的数据? 无尽的WA。。。RT #include<iostream> #include<string> using namespace std; int main() { char a[5000],b[5000]; int i,j,n,p,q,t,m; while(cin>>a>>b) { p=0;t=0;m=0; while(b[p]!='\0') { n=0;q=0; for(i=p;i<strlen(b);i++) for(j=q;j<strlen(a);) { if(b[i]==a[j]) { p++; j++; q=j; n++; break; } else j++; } t++; p=t; if(m<n)m=n; } cout<<m<<endl; } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator