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 |
没re啊,你运气真不错In Reply To:为什么会output limit exceed呢,谢谢啊 Posted by:00 at 2005-07-20 23:08:05 > #include<iostream.h> > #include<string.h> > void main() > { > char d[100000][22],d1[100000][22],d2[100000][22],w[11]; > long i,j,n; > for(i=0;;i++) > { > cin.getline(d[i],22); > for(j=0;j<(long)strlen(d[i]);j++) > { > if(d[i][j]==' ') > { > for(int k=0;k<j;k++) > d1[i][k]=d[i][k]; > d1[i][j]='\0'; > for(k=j+1;k<(int)strlen(d[i]);k++) > d2[i][k-j-1]=d[i][k]; > d2[i][strlen(d[i])-j-1]='\0'; > break; > } > } > if(strlen(d[i])==0) > break; > } > n=i; > while(1) > { > cin>>w; > for(i=0;i<(long)strlen(w);i++) > { > if(w[i]<97||w[i]>122) > break; > } > if(i<(long)strlen(w)) > break; > for(i=0;i<n;i++) > { > if(!strcmp(w,d2[i])) > { > cout<<d1[i]<<endl; > break; > } > } > if(i==n) > cout<<"eh"<<endl; > } > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator