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(void){
    std::deque<string> deq;
    string s;
    while (cin>>s) {
        if (s.size()%2!=0) {
            cout<<"NA"<<endl;
        } else {
            int i=0;
            while (i<=s.size()-2) {
                string tmp=s.substr(i,2);
                i+=2;
                if (tmp=="11") {
                    deq.emplace_back("a");
                } else if (tmp=="12") {
                    deq.emplace_back("b");
                } else if (tmp=="13") {
                    deq.emplace_back("c");
                } else if (tmp=="14") {
                    deq.emplace_back("d");
                } else if (tmp=="15") {
                    deq.emplace_back("e");
                } else if (tmp=="21") {
                    deq.emplace_back("f");
                } else if (tmp=="22") {
                    deq.emplace_back("g");
                } else if (tmp=="23") {
                    deq.emplace_back("h");
                } else if (tmp=="24") {
                    deq.emplace_back("i");
                } else if (tmp=="25") {
                    deq.emplace_back("j");
                } else if (tmp=="31") {
                    deq.emplace_back("k");
                } else if (tmp=="32") {
                    deq.emplace_back("l");
                } else if (tmp=="33") {
                    deq.emplace_back("m");
                } else if (tmp=="34") {
                    deq.emplace_back("n");
                } else if (tmp=="35") {
                    deq.emplace_back("o");
                } else if (tmp=="41") {
                    deq.emplace_back("p");
                } else if (tmp=="42") {
                    deq.emplace_back("q");
                } else if (tmp=="43") {
                    deq.emplace_back("r");
                } else if (tmp=="44") {
                    deq.emplace_back("s");
                } else if (tmp=="45") {
                    deq.emplace_back("t");
                } else if (tmp=="51") {
                    deq.emplace_back("u");
                } else if (tmp=="52") {
                    deq.emplace_back("v");
                } else if (tmp=="53") {
                    deq.emplace_back("w");
                } else if (tmp=="54") {
                    deq.emplace_back("x");
                } else if (tmp=="55") {
                    deq.emplace_back("y");
                } else if (tmp=="61") {
                    deq.emplace_back("z");
                } else if (tmp=="62") {
                    deq.emplace_back(".");
                } else if (tmp=="63") {
                    deq.emplace_back("?");
                } else if (tmp=="64") {
                    deq.emplace_back("!");
                } else if (tmp=="65") {
                    deq.emplace_back(" ");
                } else {
                    cout<<"NA"<<endl;
                    deq.clear();
                    break;
                }
            }
            if (deq.size()!=0) {
                for (int i=0;i<deq.size();i++) {
                    cout<<deq[i];
                }
                cout<<endl;
            }
            deq.clear();
        }
    }
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
using namespace std;
typedef pair<int, int> pii;
#define MAX 99999999
int main(){
    char u[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;
    cin>>s;
        bool flag=true;
        if(s.length()%2){cout<<"NA"<<endl; flag=false;}
    if(flag){
    vector<pii>v(1000);
    rep(i,s.length()/2){
        v[i]=pii(s[2*i]-48,s[2*i+1]-48);
        if(v[i].first>=7||v[i].second>=6){goto E;}
    }
    rep(i,s.length()/2)
    cout<<u[v[i].first-1][v[i].second-1];
    cout<<endl;
    }
    E:;
}

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

using namespace std;

string str[6];

void make(){
  str[1] = "afkpuz";
  str[2] = "bglqv.";
  str[3] = "chmrw?";
  str[4] = "dinsx!";
  str[5] = "ejoty ";
}
int main(){
  make();
  string in;
  while(cin >> in){
    string out;
    if(in.length()%2){
      cout << "NA" << endl;
      continue;
    }
    int status = 0;
    for(int i = 0; i < in.length(); i++){
      if(in[i] < '1' || in[i] > '7') status = 1;
    }
    if(status){
      cout << "NA" << endl;
      continue;
    }
    for(int i = 0; i < in.length()-1; i+=2){
      if(in[i+1]-'0' >= 6){
	status = 1;
	break;
      }
      out += str[in[i+1]-'0'][in[i]-'0'-1];
    }
    if(status) cout <<"NA" <<endl;
    else cout << out << endl;
  }
  return 0;
}

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

int main(){
  string s;
  char data[5][7]={
    "afkpuz",
    "bglqv.",
    "chmrw?",
    "dinsx!",
    "ejoty "
  };

  while(cin>> s){
    if(s.size()%2){
      cout<< "NA"<< endl;
      continue;
    }

    for(int i=0;i<s.size();i+=2){
      cout<< data[s[i+1]-'1'][s[i]-'1'];      
    }
    cout<< endl;
  }
}

C++: #include <iostream>
using namespace std;
int main(){
	char graph[6][7] = {{0,0,0,0,0,0,0},
											{0,97,102,107,112,117,122},
											{0,98,103,108,113,118,'.'},
											{0,99,104,109,114,119,'?'},
											{0,100,105,110,115,120,'!'},
											{0,101,106,111,116,121,' '}};
	string s;
	while(cin >> s,!cin.eof()){
		if(s.size() % 2 == 1){cout << "NA" << endl;continue;};
		for(int i = 0;i < s.size();i += 2){
			if(s[i] - '0' > 6 || s[i+1] - '0' > 5){cout << "NA";break;}
			cout << graph[s[i+1]-'0'][s[i]-'0'];
		}
		cout << endl;
	}	
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(void){
	const char *table[] ={
		"afkpuz",
		"bglqv.",
		"chmrw?",
		"dinsx!",
		"ejoty "
	};

	while( true ){
		bool bNA = false;
		string s;

		cin >> s;

		if( cin.eof() )
			break;

		if( s.length() % 2 == 1 ){
			bNA = true;
			goto NA;
		}
		for(unsigned int l = 0; l < s.length(); l += 2){
			int i = s[l+1]-'0'-1;
			int j = s[l]-'0'-1;
			if( !(0 <= i && i <= 5) || !(0 <= j && j <= 6) ){
				bNA = true;
				goto NA;
			}
		}
NA:;
		if( bNA ){
			cout << "NA\n";
			continue;
		}

		for(unsigned int l = 0; l < s.length(); l += 2){
			int i = s[l+1]-'0'-1;
			int j = s[l]-'0'-1;
			cout << table[i][j];
		}
		cout << '\n';
	}

	return 0;
}