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 |
Runtime Error各位大牛帮忙看看为什么吧#include<iostream> #include<string> using namespace std; struct dictionary{ char orgi[25]; char dic[25]; }; dictionary dd[10001]; int main(){ int count=0; int sum=0; int i; bool tag; char ss[25],*ch; while(gets(ss) && ss[0]!='\0' &&count<100000){ ch=strstr(ss," "); int address=ch-ss; strcpy(dd[count].dic,&ss[address+1]); ss[address]='\0'; strcpy(dd[count].orgi,ss); count++; } while(gets(ss) && ss[0]!='\0' && sum<100000){ sum++; tag=false; for(i=0;i<=count;i++) if(strcmp(dd[i].dic,ss)==0){ tag=true; break; } if(tag) cout<<dd[i].orgi<<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