/**//*
ID: lorelei3
PROG: namenum
LANG: C++
*/
#include <fstream>
#include <string>
using namespace std;
const char code[26] = {'2','2','2','3','3','3','4','4','4','5','5','5','6','6','6','7','0','7','7','8','8','8','9','9','9','0'};
int main(){
bool flag = false;
string digits, b, s;
ifstream in1("namenum.in");
ifstream in2("dict.txt");
ofstream out("namenum.out");
in1>>digits;
while(in2>>s){
if(code[s[0]-'A'] != digits[0])
continue;
int len = s.length();
b = s;
for(int i=0; i<len; ++i){
b[i] = code[s[i]-'A'];
}
if(b == digits){
flag = true;
out<<s<<endl;
}
}
if(!flag)
out<<"NONE"<<endl;
return 0;
}
posted on 2010-11-09 00:46
小阮 阅读(148)
评论(0) 编辑 收藏 引用 所属分类:
USACO