/*
ID:wsbqw1
PROG:namenum
LANG:C++
*/
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
int main()
{
int i,j=0;
string s;
ifstream fin ("dict.txt");
ofstream fout ("namenum.out");
ifstream fin1 ("namenum.in");
fin1>>s;
string name;
char c[15];
while(fin>>name)
{
for(i=0;i<name.length();i++)
{
if(name[i]=='A' || name[i]=='B' || name[i]=='C')
{
c[i]='2';
}
else if(name[i]=='D' || name[i]=='E' || name[i]=='F')
{
c[i]='3';
}
else if(name[i]=='G' || name[i]=='H' || name[i]=='I')
{
c[i]='4';
}
else if(name[i]=='J' || name[i]=='K' || name[i]=='L')
{
c[i]='5';
}
else if(name[i]=='M' || name[i]=='N' || name[i]=='O')
{
c[i]='6';
}
else if(name[i]=='P' || name[i]=='R' || name[i]=='S')
{
c[i]='7';
}
else if(name[i]=='T' || name[i]=='U' || name[i]=='V')
{
c[i]='8';
}
else if(name[i]=='W' || name[i]=='X' || name[i]=='Y')
{
c[i]='9';
}
}
c[name.length()]='\0';
if(c==s)
{
fout<<name<<endl;
j++;
}
}
if(j==0)
fout<<"NONE"<<endl;
return 0;
}
name that number
最新推荐文章于 2022-12-24 20:17:29 发布