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 |
谁帮我看看 running error 怎么处理#include <iostream> #include <string> using namespace std; string input[10]; string tem[60],tem2[60]; int sum; int findc(int a,int b) { string aa=input[0].substr(a,b); for(int i=1;i<sum;i++) if(input[i].find(aa)==-1) return b-1; if(a+b==59) return b; return findc(a,b+1); } int main() { int a,i,k,n,num,s; cin>>n; while(n--) { cin>>num; for(i=0;i<num;i++) cin>>input[i]; sum=num; i=0; a=0; while(a<=57) { int d=findc(a,3); if(d==2) a++; else { tem[i]=input[0].substr(a,d); i++; a=a+d; } } s=0; if(i==0) cout<<"no significant commonalities"<<endl; else { for(k=0;k<i;k++) { if(s<tem[k].size()) s=k; } cout<<tem[s]<<endl; } } return 0; } 在我机器上运行好使 ,上去就runningerror Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator