#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<string>
#include<map>
#include<vector>
using namespace std;
int main()
{
ios::sync_with_stdio(false);cin.tie(0);
string words,key;
map<string,string> m;
while(cin>>words&&words[0]!='X')
{
key=words;
sort(key.begin(),key.end());
m[words]=key;
}
while(cin>>words&&words[0]!='X')
{
sort(words.begin(),words.end());
int flag=1;
for(map<string,string>::iterator it=m.begin();it!=m.end();it++)
if(it->second==words)
{
cout<<it->first<<endl;
flag=0;
}
if(flag)
cout<<"NOT A VALID WORD"<<endl;
cout<<"******"<<endl;
}
return 0;
}
07-24
298
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交