标签:os io for amp ios algorithm hdu return
# include <stdio.h> # include <string> # include <map> # include <iostream> # include <algorithm> using namespace std; int main() { string s,t; int flag; map<string,string>q; while(cin>>s&&s!="XXXXXX") { t=s; sort(s.begin(),s.end()); q[t]=s; } while(cin>>s&&s!="XXXXXX") { sort(s.begin(),s.end()); map<string,string>::iterator it; flag=0; for(it=q.begin();it!=q.end();it++) { if(it->second==s) { cout<<it->first<<endl; flag=1; } } if(!flag) cout<<"NOT A VALID WORD"<<endl; cout<<"******"<<endl; } return 0; }
hdu 1113 Word Amalgamation (map),布布扣,bubuko.com
hdu 1113 Word Amalgamation (map)
标签:os io for amp ios algorithm hdu return
原文地址:http://blog.csdn.net/lp_opai/article/details/38398117