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:贴个简单耗时的代码 Posted by:shun_fzll at 2012-08-19 11:25:00 > #include<iostream> > #include<map> > using namespace std; > #include<string> > map<string,string>mp; > int main() > { > char a[30],b[15],c[15]; > while(gets(a)&&a[0]!='\0') > { > sscanf(a,"%s %s",&b,&c); > mp[c]=b; > } > char s[15]; > while(gets(s)&&s[0]!='\0') > { > if(mp[s][0]=='\0')cout<<"eh\n"; > else cout<<mp[s]<<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