/*********************************
* 2012/07/13 *
* AOJ_Volume1_0127 *
* Pocket_Pager_Input *
* crane *
**********************************/
#include<iostream>
#include<string>
using namespace std;
char data[7][6] ={
{},
{' ','a','b','c','d','e'},
{' ','f','g','h','i','j'},
{' ','k','l','m','n','o'},
{' ','p','q','r','s','t'},
{' ','u','v','w','x','y'},
{' ','z','.','?','!',' '}
};
int main(){
string input;
while(1){
getline(cin, input);
if(input.empty())break;
bool frag = true;
string output = "";
if(input.length() % 2 != 0)
frag = false;
for(int i=0; i<input.length() && frag==true; i+=2){
int in1 = (int) input.at(i) - '0';
int in2 = (int) input.at(i+1) - '0';
if(0<in1 && in1 < 7 && 0 < in2 && in2 < 6)
output += data[in1][in2];
else
frag = false;
}
if(frag) cout << output << endl;
else cout << "NA" << endl;
}
return 0;
}
0 件のコメント:
コメントを投稿