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 <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; ++i)
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define P pair<int, int>

map<string, char> m;

void set_m(){
  m["11"] = 'a';
  m["12"] = 'b';
  m["13"] = 'c';
  m["14"] = 'd';
  m["15"] = 'e';
  m["21"] = 'f';
  m["22"] = 'g';
  m["23"] = 'h';
  m["24"] = 'i';
  m["25"] = 'j';
  m["31"] = 'k';
  m["32"] = 'l';
  m["33"] = 'm';
  m["34"] = 'n';
  m["35"] = 'o';
  m["41"] = 'p';
  m["42"] = 'q';
  m["43"] = 'r';
  m["44"] = 's';
  m["45"] = 't';
  m["51"] = 'u';
  m["52"] = 'v';
  m["53"] = 'w';
  m["54"] = 'x';
  m["55"] = 'y';
  m["61"] = 'z';
  m["62"] = '.';
  m["63"] = '?';
  m["64"] = '!';
  m["65"] = ' ';
}

bool has_key(string s){
  return ((m.find(s) == m.end()) ? false : true);
}

int main() {
  set_m();
  string str;
  while(cin >>str){
    string ans = "";
    if(str.length() % 2 != 0) ans = "NA";
    for(int i = 0; ans != "NA" && i < str.size(); i += 2){
      string now = str.substr(i, 2);
      if(!has_key(now)) ans = "NA";
      else ans += m[now];
    }
    cout <<ans <<endl;
  }
  return 0;
}

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