Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	table := [6][5]string{
		{"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", ".", "?", "!", " "},
	}
	for scanner.Scan() {
		input := strings.Split(scanner.Text(), "")
		if len(input)%2 != 0 {
			fmt.Println("NA")
			continue
		}
		ret := make([]string, 0)
		for i := 0; i < len(input); i += 2 {
			row, _ := strconv.Atoi(input[i])
			col, _ := strconv.Atoi(input[i+1])
			// log.Println(table[row-1][col-1])
			ret = append(ret, table[row-1][col-1])
		}
		fmt.Println(strings.Join(ret, ""))
	}
}

C++: #include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#include<algorithm>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    string s, ans;
    while(cin >> s){
        int i = 0;
        char a;
        ans = "";
        while(i < s.size()){
            if(s.size() % 2){
                ans = "NA";
                break;
            }
            if(s[i] == '1'){
                a = ('a' - 1) + (s[i + 1] - '0');
            }else if(s[i] == '2'){
                a = ('f' - 1) + (s[i + 1] - '0');
            }else if(s[i] == '3'){
                a = ('k' - 1) + (s[i + 1] - '0');
            }else if(s[i] == '4'){
                a = ('p' - 1) + (s[i + 1] - '0');
            }else if(s[i] == '5'){
                a = ('u' - 1) + (s[i + 1] - '0');
            }else if(s[i] == '6'){
                if(s[i + 1] == '1')
                    a = 'z';
                else if(s[i + 1] == '2')
                    a = '.';
                else if(s[i + 1] == '3')
                    a = '?';
                else if(s[i + 1] == '4')
                    a = '!';
                else if(s[i + 1] == '5')
                    a = ' ';
            }else{
                ans = "NA";
                break;
            }
            ans+= a;
            i+= 2;
        }
        cout << ans << endl;
    }
}

C++: #include <iostream>
using namespace std;

int main(){
    string msg;
    while(cin >> msg){
        if( msg.length()%2 ){
            cout << "NA" << endl;
            continue;
        }
        for(int i = 0; i < msg.length(); i+=2){
            int x = msg[i]-'0', y = msg[i+1]-'0';
            char z = (x-1)*5+(y-1)+'a';
            if( 'a' <= z && z <= 'z' ) cout << z;
            else{
                if( z-'a' == 26 ) cout << '.';
                if( z-'a' == 27 ) cout << '?';
                if( z-'a' == 28 ) cout << '!';
                if( z-'a' == 29 ) cout << ' ';
            }
        }
        cout << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <string>

using namespace std;

int main(void){
  string arg;

  while(cin >> arg){
	int n=arg.size();
	int tmpi;
	char tmpc;
	string str = "";
	bool ok = true;
	if(n%2==1){
	  cout << "NA" << endl;
	  continue;
	}
	for(int i=0;i<n/2;i++){
	  tmpi = 0;
	  tmpc = arg[i*2];
	  tmpi += (tmpc - '0') * 10;
	  tmpc = arg[i*2+1];
	  tmpi += tmpc - '0';
	  switch(tmpi){
	  case 11:
		str +="a";
		break;
	  case 12:
		str +="b";
		break;
	  case 13:
		str +="c";
		break;
	  case 14:
		str +="d";
		break;
	  case 15:
		str +="e";
		break;
	  case 21:
		str +="f";
		break;
	  case 22:
		str +="g";
		break;
	  case 23:
		str +="h";
		break;
	  case 24:
		str +="i";
		break;
	  case 25:
		str +="j";
		break;
	  case 31:
		str +="k";
		break;
	  case 32:
		str +="l";
		break;
	  case 33:
		str +="m";
		break;
	  case 34:
		str +="n";
		break;
	  case 35:
		str +="o";
		break;
	  case 41:
		str +="p";
		break;
	  case 42:
		str +="q";
		break;
	  case 43:
		str +="r";
		break;
	  case 44:
		str +="s";
		break;
	  case 45:
		str +="t";
		break;
	  case 51:
		str +="u";
		break;
	  case 52:
		str +="v";
		break;
	  case 53:
		str +="w";
		break;
	  case 54:
		str +="x";
		break;
	  case 55:
		str +="y";
		break;
	  case 61:
		str +="z";
		break;
	  case 62:
		str +=".";
		break;
	  case 63:
		str +="?";
		break;
	  case 64:
		str +="!";
		break;
	  case 65:
		str +=" ";
		break;
	  default:
		ok = false;
	  }
	  if(!ok) break;
	}
	if(ok){
	  cout << str << endl;
	}else{
	  cout << "NA" << endl;
	}
  }
}

C++: #include<iostream>
#include<string>
#define rep(i,x) for(int i=0;i<x;i++)
using namespace std;
string s;
char tab[10][10]={"abcde","fghij","klmno","pqrst","uvwxy","z.?! "};
void solve(){
	int n=0,k=0;
	char ans[1000];
	if(s.size()%2!=0){
		cout<<"NA"<<endl;
		return ;
	}
	else{
		while(n<s.size()){
			if(s[n]>='1'&&s[n]<'7'&&s[n+1]>='1'&&s[n+1]<'6')
			ans[k++]=tab[s[n]-1-'0'][s[n+1]-1-'0'];
			else{

				cout<<"NA"<<endl;
				return ;
			}
			n+=2;
		}
		rep(i,k)
		cout<<ans[i];
		cout<<endl;
	}
}
int main(){
	while(cin>>s){
		solve();
	}
	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;

int main()
{
	char tb[9][9];
	for(int i=1; i<=7; i++)
	for(int j=1; j<=6; j++)
		tb[i][j]='a'+(5*(i-1)+j-1);
		
	tb[6][2]='.';
	tb[6][3]='?';
	tb[6][4]='!';
	tb[6][5]=' ';
	
	string b;
	while(cin >> b)
	{
		string res;
		bool g=true;
		if(b.size()%2==1) g=false;
		else
		{
			for(int i=0; i<b.size(); i+=2)
			{
				int f=b[i]-'0', s=b[i+1]-'0';
				if(f>6||s>5)
				{
					g=false;
					break;
				}
				res+=tb[f][s];
			}
		}
		
		if(g) cout << res << endl;
		else cout << "NA" << endl;
		
	}
}

C++: #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <fstream>
#include <sstream>
#include <math.h>
#include <queue>
#include <stack>
#include <math.h>

using namespace std;

char translation_table[6][5] = {'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(cin>>input){
        if(input.length()%2!=0)cout<<"NA"<<endl;
        else{
            string ans;
            for(int i=0; i<input.length(); i++){
                int y = input[i]-'0';
                i++;
                int x = input[i]-'0';
                if(y<=6&&x<=5&&0<y&&0<x){
                    ans+=translation_table[y-1][x-1];
                }else{
                    ans = "NA";
                    break;
                }
            }
            
            cout<<ans<<endl;
        }
    }

}