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:哪位大神告诉我为什么交g++~AC,交C++却WA???!!!In Reply To:哪位大神告诉我为什么交g++~AC,交C++却WA???!!! Posted by:490953931 at 2016-08-05 17:38:17 > /** > * @Date: 2016-07-21 10-41-21 > * @Project: ACM > * @Last modified time: 2016-08-05 05-22-30 > */ > > #include <cstdio> > #include <iostream> > #include <map> > #include <string> > using namespace std; > > map<string,string> m; > > int main(){ > char str[15],a[15],b[15]; > string s; > while(gets(str)&&str[0]!='\0'){ > sscanf(str,"%s%s",a,b); > m[b]=a; > } > while(cin>>s){ > if(m[s].size()) cout<<m[s]<<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