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])
			ret = append(ret, table[row-1][col-1])
		}
		fmt.Println(strings.Join(ret, ""))
	}
}

C++: #include<bits/stdc++.h>
using namespace std;

int main(){
  char zu[6][5];
  string bun;
  char x='a';
  int nagasa;
  int smp1,smp2;
  for(int i=0;i<6;i++){
    for(int j=0;j<5;j++){
      zu[i][j] = x;
      x++;
    }
  }
  zu[5][1]='.';
  zu[5][2]='?';
  zu[5][3]='!';
  zu[5][4]=' ';
  while(cin >> bun){
    nagasa = bun.size();
    int flag=0;
    for(int i=0;i<nagasa;i=i+2){
      smp1 = bun[i]-'0'-1;
      smp2 = bun[i+1]-'0'-1;
      if(smp1 > 5 || smp2 > 4 || smp1 <= -1 || smp2 <= -1){
	flag = 1;
      }
    }
    int a = nagasa%2;
    if(a == 0 && flag == 0){
      for(int i=0;i<nagasa;i=i+2){
	smp1 = bun[i]-'0'-1;
	smp2 = bun[i+1]-'0'-1;
	cout << zu[smp1][smp2];
      }
      cout << endl;
    }
    else{
    cout << "NA" << endl;
    }
  }
}

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


int main(){
    char map[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', '.', '?', '!', ' '}};

    string s;
    while (cin >> s){
	bool err = false;
	for (int i = 0; i < s.size(); i++){
	    if (i % 2 && s[i] > '5') err = true;
	    else if (i % 2 == 0 && s[i] > '6') err = true;
	}
	
	if (s.size() % 2 || err) cout << "NA" << endl;
	else {
	    for (int i = 0; i < s.size()-1; i+=2){
		cout << map[s[i]-'0'-1][s[i+1]-'0'-1];
	    }
	    cout << endl;
	}
    }
}

C++: #include <bits/stdc++.h>
using namespace std;

const string characters = "abcdefghijklmnopqrstuvwxyz.?! ";

string convert(const string &number) {
	if(number.size() & 1) return "NA";

	string res = "";
	for(unsigned i = 0; i < number.size(); i += 2) {
		if(!('1' <= number[i] && number[i] <= '6')) return "NA";
		if(!('1' <= number[i] && number[i] <= '5')) return "NA";


		const unsigned idx = (number[i] - '1') * 5 + (number[i + 1] - '1');

		if(idx >= characters.size()) return "NA";

		res += characters[idx];
	}

	return res;
}

int main() {
	string number;
	while(cin >> number) {
		cout << convert(number) << endl;
	}

	return EXIT_SUCCESS;
}

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

int main(void)
{
	int n;
	string instr;

	while(cin >> instr, !cin.eof()){
		if(instr.length() % 2){
			cout << "NA"  << endl;
			continue;
		}
		bool cannot = false;
		for(int i = 0; i < instr.length()-1; i+= 2){
			if(instr[i] < '1' || instr[i] > '6' || instr[i+1] < '1' || instr[i+1] > '5'){
				cannot = true;
				break;
			}
		}
		if(cannot){
			cout << "NA" << endl;
			continue;
		}
		for(int i = 0; i < instr.length()-1; i+=2){
			int a = instr[i]-'0', b = instr[i+1]-'0';
			int c = b+(a-1)*5;
			if(c <= 26)
				cout << (char)(c - 1+'a');
			else {
				switch(c%26){
					case 1:
						cout << '.';
						break;
					case 2:
						cout << '?';
						break;
					case 3:
						cout << '!';
						break;
					default:
						cout << ' ';
						break;
				}
			}

		}
		cout << endl;
			
	}

	return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int main() {
	string s;
	while (cin >> s) {
		if (s.size() % 2) { puts("NA"); continue; }
		string res;
		int pos = 0;
		while (pos + 1 < s.size()) {
			int d = stoi(to_string(s[pos] - 48) + to_string(s[pos + 1] - 48));
			if (d <= 10 || 65 < d) { puts("NA"); goto p; }
			else if (10 < d&&d <= 15)res += (char)d + 86;
			else if (20 < d&&d <= 25)res += (char)d + 81;
			else if (30 < d&&d <= 35)res += (char)d + 76;
			else if (40 < d&&d <= 45)res += (char)d + 71;
			else if (50 < d&&d <= 55)res += (char)d + 66;
			else if (d == 61)res += 'z';
			else if (d == 62)res += '.';
			else if (d == 63)res += '?';
			else if (d == 64)res += '!';
			else if (d == 65)res += ' ';
			pos += 2;
		}
		cout << res << endl;
	p:;
	}
}

C++: #include <iostream>
using namespace std;
/*
  1 2 3 4 5 6
1 a f k p u z
2 b g l q v .
3 c h m r w ?
4 d i n s x !
5 e j o t y  
*/
char conv(string str) {
	int c=str[0]-'0'-1, v=str[1]-'0'-1;
	if (c<5) {
		return 'a'+5*c+v;
	} else {
		switch (v) {
			case 0:
				return 'z';
			case 1:
				return '.';
			case 2:
				return '?';
			case 3:
				return '!';
			case 4:
				return ' ';
		}
	}
}
int main() {
	string mes;
	while (cin>>mes) {
		if (mes.length()%2!=0) cout << "NA" << endl;
		else {
			string temp="", res="";
			for (int i=0; i<mes.length(); i++) {
				if (i%2!=0) {
					temp += mes[i];
					res += conv(temp);
					temp = "";
				} else temp += mes[i];
			}
			cout << res << endl;
		}
	}
}

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;
}