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 |
贴个简单耗时的代码#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