Go: // Keitai Message
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2006&lang=jp
package main

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

var table = []string{
	"",
	".,!? ",
	"abc",
	"def",
	"ghi",
	"jkl",
	"mno",
	"pqrs",
	"tuv",
	"wxyz",
}

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	n := nextInt(sc)

	for i := 0; i < n; i++ {
		message := nextString(sc)
		currentButton, count := 0, 0
		for _, word := range message {
			// 確定の処理を書く
			if word == '0' {
				if currentButton == 0 {
					count = 0
					continue
				}
				mod := len(table[currentButton])
				tmp := table[currentButton][(count-1)%mod]
				currentButton, count = 0, 0
				fmt.Printf("%c", tmp)
			} else {
				count++
				currentButton = int(word) - 48 // '0'はASCIIで48
			}
		}
		fmt.Println()
	}
}

func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func nextString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<cmath>
#include<string>
#include<stdlib.h>

using namespace std;

#define ll long long int
#define ld long double
#define reps(i,f,n) for(int i=f;i<n;i++)
#define rep(i,n) reps(i,0,n)
#define m1 cout<<"move1"<<endl
#define m2 cout<<"move2"<<endl
#define m3 cout<<"move3"<<endl
#define m4 cout<<"move4"<<endl


int main(){
  ll num = 0;
  string s;
  char data[10][7] = {".,!? $","abc$$","def$$","ghi$$","jkl$$","mno$$","pqrs$","tuv$","wxyz$"};
  char ans;
  ll temp = 0;
  ll cou = 0;

  cin>>num;
  // m1;

  rep(i,num){
    cin>>s;
    //m2;
    
    rep(i,s.size()){
      ans = '#';
      cou = 0;
      while(s[i] != '0'){
	//m3;
	temp = s[i] - '0' -1;
	//m3;
	//cout<<temp<<endl;
	ans = data[temp][cou];
	//cout<<temp<<endl;
	//	m4;
	if(data[temp][cou] == '$'){
	  cou = 0;
	  ans = data[temp][cou];
	}
	cou++;
	i++;
      }
      if(ans != '#'){
	cout<<ans;
      }
      
    }
    cout<<endl;
  }
  return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main() {
	int n; cin >> n;
	for (int j = 0; j < n; j++){
		string s; cin >> s;
		char c;
		int num = 0;
		for (int i = 0; i != s.size(); i++){
			if (i == 0 || s[i - 1] == '0') {
				if (s[i] == '0')goto cont;
				else {
					c = s[i]; 
					num++;
				}
			}
			else{
				if (s[i] == '0') {
					if (c == '1') {
						num = num % 5;
						if (num == 1)cout << '.';
						else if (num == 2)cout << ',';
						else if (num == 3)cout << '!';
						else if (num == 4)cout << '?';
						else cout << ' ';
					}
					else if (c == '2') {
						num = num % 3;
						if (num == 1)cout << 'a';
						else if (num == 2)cout << 'b';
						else cout << 'c';
					}
					else if (c == '3') {
						num = num % 3;
						if (num == 1)cout << 'd';
						else if (num == 2)cout << 'e';
						else cout << 'f';
					}
					else if (c == '4') {
						num = num % 3;
						if (num == 1)cout << 'g';
						else if (num == 2)cout << 'h';
						else cout << 'i';
					}
					else if (c == '5') {
						num = num % 3;
						if (num == 1)cout << 'j';
						else if (num == 2)cout << 'k';
						else cout << 'l';
					}
					else if (c == '6') {
						num = num % 3;
						if (num == 1)cout << 'm';
						else if (num == 2)cout << 'n';
						else cout << 'o';
					}
					else if (c == '7') {
						num = num % 4;
						if (num == 1)cout << 'p';
						else if (num == 2)cout << 'q';
						else if (num == 3)cout << 'r';
						else cout << 's';
					}
					else if (c == '8') {
						num = num % 3;
						if (num == 1)cout << 't';
						else if (num == 2)cout << 'u';
						else cout << 'v';
					}
					else if (c == '9') {
						num = num % 4;
						if (num == 1)cout << 'w';
						else if (num == 2)cout << 'x';
						else if (num == 3)cout << 'y';
						else cout << 'z';
					}
					num = 0;
				}
				else num++;
			}
		cont:;
		}
		cout << endl;
	}
}

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

const string M[] = {"",
                    ".,!? ",
                    "abc",
                    "def",
                    "ghi",
                    "jkl",
                    "mno",
                    "pqrs",
                    "tuv",
                    "wxyz"};
  
int main() {
  int T;
  cin >> T;
  cin.ignore();
  while(T--) {
    string s;
    getline(cin, s);
    for(int i = 0, j = -1, k = -1; i < s.size(); ++i) {
      int d = s[i] - '0';
      if(d == 0) {
        if(j != -1) {
          cout << M[j][k];
          j = k = -1;
        }
      } else {
        j = d;
        k = (k + 1) % M[j].size();
      }
    }
    cout << endl;
  }
  return 0;
}

C++: #include <cstdio>
#include <utility>
#include <vector>
#include <string>
using namespace std;

#define gcu getchar_unlocked
int in(int c){int n=0;bool m=false;if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0');return m?-n:n;}
int in() {return in(gcu());}
bool scan(int &n){int c=gcu();return c==EOF?false:(n=in(c),true);}
bool scan(char &c){c=gcu();gcu();return c!=EOF;}
bool scan(string &s){int c;s="";
	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
#define pcu putchar_unlocked
#define vo inline void out
template <typename T>
vo(T n){static char buf[20];char *p=buf;
	if(n<0)pcu('-'),n*=-1;if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10;
	while (p!=buf)pcu(*--p);}
vo(const char *s){while(*s)pcu(*s++);}
vo(char c){pcu(c);}
vo(string &s){for (char c: s) pcu(c);}
template <typename head, typename... tail> vo(head&& h, tail&&... t){out(h);out(move(t)...);}
//template <typename T> vo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);out('\n');}
#undef vo

int main() {
	vector<string> b = {"", ".,!? ", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"};
	string s;
	for (int i = in(); i--;) {
		scan(s);
		int n = -1, p = -1;
		for (char c: s) {
			c -= '0';
			if (c == n)
				p++;
			else {
				if (!c && n != -1)
					out(b[n][(p) % (int) b[n].size()]);
				n = c, p = 0;
			}
		}
		out('\n');
	}
}

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

char bt[9][8] = {
    ".,!? ",
    "abc",
    "def",
    "ghi",
    "jkl",
    "mno",
    "pqrs",
    "tuv",
    "wxyz"
};

int main(){
    int N;
    for(scanf("%d", &N); N--;){
        char mes[128];
        scanf(" %s", mes);
        int len = strlen(mes);
        int prv = 0, count = 0;
        for(int i = 0; i < len; i++){
            if(mes[i] == '0'){
                if(prv > 0){
                    --prv;
                    printf("%c", bt[prv][--count % strlen(bt[prv])]);
                }
                count = 0;
            }else{
                count++;
            }
            prv = mes[i] - '0';
        }
        if(prv > 0){
            --prv;
            printf("%c", bt[prv][--count % strlen(bt[prv])]);
        }
        puts("");
    }
    return 0;
}