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 <iostream>
#include <cstring>
#include <cstdlib>
using namespace std;
int main()
{
	int i, j = -1;
	char c, d, s[201], r[1024][101], t[5][7] = {"afkpuz", "bglqv.", "chmrw?", "dinsx!", "ejoty "};
	bool f;
	while (cin >> s)
	{
		if (cin.eof()) break;
		j++;
		if (strlen(s)%2 == 0)
		{
			for (i = f = 0; i < strlen(s); i += 2, f = 0)
			{
				c = s[i], d = s[i+1];
				if (atoi(&c) > 6 || atoi(&d) > 5)
				{
					strcpy(r[j], "NA");
					f = 1;
					break;
				}
				r[j][i/2] = t[atoi(&d)-1][atoi(&c)-1];
			}
			if (f)
				continue;
			r[j][i/2] = '\0';
		}
		else
			strcpy(r[j], "NA");
	}
	for (i = 0; i < j; i++)
		cout << r[i] << endl;
}

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

int main()
{
  string s;

  for(;cin>>s;)
    {
      bool flag=true;
      string ans="";
      if(s.size()%2!=0)
	  flag=false;
      for(int i=0;i<s.size()&&flag;i+=2)
	{
	  if(s[i]>'6' ||s[i+1]>'5'||s[i]<'1'||s[i+1]<'1')
	    flag=false;

	  if(s[i]=='6')
	    {
	      if(s[i+1]=='1')
		ans+="z";
	      if(s[i+1]=='2')
		ans+=".";
	      if(s[i+1]=='3')
		ans+="?";
	      if(s[i+1]=='4')
		ans+="!";
	      if(s[i+1]=='5')
		ans+=" ";
	    }
	  else
	    {
	      int a=s[i]-'0';
	      int b=s[i+1]-'0';
	      char tmp='a'+(5*(a-1))+(b-1);
	      ans+=tmp;
	    }
	}
      
      if(flag)
	cout<<ans<<endl;
      else
	cout<<"NA"<<endl;
    }
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	string a="abcdefghijklmnopqrstuvwxyz.?! ";
	string b;
	while(cin>>b){
		string f="";
		if(b.length()%2==1) {
			cout<<"NA"<<endl;
			goto stop;
		}
		for(int i=0;i<b.length();i+=2){
			int c,d;
			c=(int)b[i]-'0';
			d=(int)b[i+1]-'0';
			if(c>6||d>5) {
				cout<<"NA"<<endl;
				goto stop;
			}
			c--;
			int e=c*5+d;
			f+=a[e-1];
		}
		cout<<f<<endl;
		stop:;
	}
}

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

int main(){
	char p[5][6] =
	{{'a','f','k','p','u','z'},
	 {'b','g','l','q','v','.'},
	 {'c','h','m','r','w','?'},
	 {'d','i','n','s','x','!'},
	 {'e','j','o','t','y',' '}};
	string s;	
	while(cin >> s){
		bool flag = false;
		for(size_t i=0;i<s.size();i+=2){
			if(s[i]>'6' || s[i]<'1' || s[i+1]>'5' || s[i+1]<'1')
				flag = true;
		}
		if(flag||s.size()%2){
			cout << "NA" << endl;
		}else{
			for(size_t i=0;i<s.size();i+=2){
				cout << p[s[i+1]-'0'-1][s[i]-'0'-1];
			}
			cout << endl;
		}
	}
}

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

const char symbol[4] = { '.', '?', '!', ' ' };

int main()
{
	std::string s;
	while( std::cin >> s )
	{
		if( s.size() & 1 )
			std::cout << "NA" << std::endl;
		else
		{
			std::string res;
			bool f = true;

			for( int i = 0; i < s.size(); i += 2 )
			{
				if( s[i] < '0' || s[i] > '6' || s[i+1] < '0' || s[i+1] > '5' )
				{
					f = false; 
					break;
				}

				int n = ( s[i] - '1' ) * 5 + s[i+1] -'1';
	
				if( n > 29 )
				{
					f = false;
					break;
				}
				else
					res += n >= 26 ? symbol[n-26] : 'a' + n;
			}

			std::cout << ( f ? res : "NA" ) << std::endl;
		}
	}

	return 0;
}

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

string enc[5] = {"afkpuz","bglqv.","chmrw?","dinsx!","ejoty "};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  int w,h;
  while(cin>>s){
    string ans ="";
    bool f = true;
    for(int i = 0; i < s.size();i+=2){
      w = s[i+1]-'0'-1;
      h = s[i]-'0'-1;
      if( w > 6 || h > 5 || s.size() % 2){
        cout << "NA"<<endl;
        f = false;
        break;
      }
      ans += enc[w][h];
    }
    if(f) cout << ans << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
char moji[5][7]={
		"afkpuz",
		"bglqv.",
		"chmrw?",
		"dinsx!",
		"ejoty ",
};
char retu[401];
char mes[201];
//'1'の文字コードは49
void Encode(){
	int i=0;
	int num1,num2;
	int cnt=0;
	int flg=0;
	while(retu[i]!='\0'){
		num1=retu[i]-49;
		if(retu[i+1]=='\0'){flg=1;break;}
		else{num2=retu[i+1]-49;}
		mes[cnt]=moji[num2][num1];
		cnt++;
		i+=2;
	}
	if(flg==1){
		printf("NA\n");
	}
	else{
		mes[cnt]='\0';
		printf("%s\n",mes);
	}
}
int main(){
	int mes_num;
	scanf("%d",&mes_num);
	for(int i=0;i<mes_num;i++){
		scanf("%s",retu);
		Encode();
	}
	return 0;
}

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

const char symbol[4] = { '.', '?', '!', ' ' };

int main()
{
	std::string s;
	while( std::cin >> s )
	{
		if( s.size() & 1 )
			std::cout << "NA" << std::endl;
		else
		{
			std::string res;
			bool f = true;

			for( int i = 0; i < s.size(); i += 2 )
			{
				if( s[i] < '0' || s[i] > '9' || s[i+1] < '0' || s[i+1] > '9' )
				{
					f = false; 
					break;
				}

				int n = ( s[i] - '1' ) * 5 + s[i+1] -'1';
	
				if( n < 0 || n > 29 )
				{
					f = false;
					break;
				}
				else
					res += n >= 26 ? symbol[n-26] : 'a' + n;
			}

			std::cout << ( f ? res : "NA" ) << std::endl;
		}
	}

	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

char c[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 str;
	
	while(true){
		cin >> str;
		if(cin.eof()){
			break;
		}
		if(str.size() % 2 != 0){
			printf("NA\n");
			continue;
		}
		for(int i = 0; i < str.size(); i += 2){
			printf("%c", c[str[i] - '0' - 1][str[i + 1] - '0' - 1]);
		}
		printf("\n");
	}
	
	return 0;
}