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 |
WA,请大牛们帮我看看什么问题#include<iostream> using namespace std; char ary[1000000]; char bry[1000000]; int main(){ char temp[20]; int i,j; int count=0; int work; memset(ary,0,sizeof(ary)); memset(bry,0,sizeof(bry)); while(cin.getline(temp,20) && temp[0]!='\0'){ i=0; while(temp[i]!=' '){ ary[10*count+i]=temp[i]; i++; } i++; j=0; while(temp[i]!='\0'){ bry[10*count+j]=temp[i++]; j++; } count++; } while(gets(temp)){ j=0; i=0; while(temp[j]!='\0' && i<=count){ work=1; if(temp[j++]!=bry[10*i+j]){ work=0; i++; j=0; continue; } } if(work){ for(j=0;ary[10*i+j]!=0;j++) cout<<ary[10*i+j]; cout<<endl; } else cout<<"eh"<<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