这个,说实话只有读得时候有点恶心,尤其是在我对C/C++完全没入门的情况下。
1 /*
2 ID: 31440461
3 LANG: C++
4 TASK: namenum
5 */
6 #include<iostream>
7 using namespace std;
8 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'};
9 char a[13],b[13];
10 int main()
11 {
12 freopen("namenum.in","r",stdin);
13 freopen("namenum.out","w",stdout);
14 freopen("dict.txt","r",stderr);
15 bool flag=1;
16 cin>>a;
17 while (fscanf(stderr,"%s",b)!=EOF)
18 {
19 bool flg=1;
20 if (strlen(a)!=strlen(b)) continue;
21 for (int i=0;b[i];i++) flg=flg&&(code[b[i]-'A']==a[i]);
22 if (flg) flag=0,cout<<b<<endl;
23 }
24 if (flag) cout<<"NONE"<<endl;
25 return 0;
26 }
27