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 <cstdio>
#include <string>
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <set>
#include <map>
using namespace std;

#define REP(i, s, e) for (int i = (s); i < (e); i++)
#define REPI(i, s, e) for (int i = (s); i <= (e); i++)
#define rep(i, n) REP(i, 0, n)
#define repi(i, n) REPI(i, 0, n)
#define ALL(v) (v).begin(), (v).end()

#define dump(x) (cout << #x << " = " << x << endl)
#define dump2(x, y) (cout << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")" << endl)

typedef long long ll;
typedef pair<int, int> pii;

int main(void)
{
	string ms[] = { "",
					".,!? ",
                    "abc",
					"def",
					"ghi",
					"jkl",
					"mno",
					"pqrs",
					"tuv",
					"wxyz" };

	int n;
	cin >> n;
	rep(TTT, n) {
		string str;
		cin >> str;
		vector<pii> ks;
		int prev = 0;
		int cnt = 0;
		rep(k, str.size()) {
			int i = str[k]-'0';
			if (prev != i) {
				if (prev != 0)
					putchar(ms[prev][cnt]);
				prev = i;
				cnt = 0;
			} else {
				if (prev != 0)
					cnt = (cnt+1)%ms[prev].size();
			}
		}
		if (prev != 0)
			putchar(ms[prev][cnt]);
		putchar('\n');
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
char ss[9][6]={".,!? ", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"};
cin>>n;
while(n--&&cin>>s){
int l=s.size();
int p=-1;
for(int i=0;i<l;++i) {
if(p<0){
if(s[i]!='0') {
p=(s[i]-'1')*10;
}
}else{
if(s[i]=='0'){
cout<<ss[p/10][p%10];
p=-1;
}else{
p=(p/10*10)+(p%10+1)%strlen(ss[p/10]);
}
}
}
cout<<endl;
}??
}

C++: #include "bits/stdc++.h"
#include<unordered_map>
#pragma warning(disable:4996)
using namespace std;

const int My_Inf=2147483647;
const long long int My_LInf=9223372036854775807;

vector<string>sts(10);

int main() {
	sts[1] = ".,!? ";
	sts[2] = "abc";
	sts[3] = "def";
	sts[4] = "ghi";
	sts[5] = "jkl";
	sts[6] = "mno";
	sts[7] = "pqrs";
	sts[8] = "tuv";
	sts[9] = "wxyz";
	int n; cin >> n;
	while (n--) {
		string st; cin >> st;
		int select = 0;
		int now = -1;
		for (int i = 0; i < st.size(); ++i) {
			if (st[i] == '0') {
				if (select) {
					cout << sts[select][now];
				}
				select = 0;
				now = -1;
			}
			else {
				select = (st[i]-'0');
				now++;
				now %= sts[select].size();
				
			}
		}
		cout << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#define R return

using namespace std;

char convert (int cnt, int num)
{
    int d;
    switch (num)
    {
    case 1:
        d=cnt%5;
        if (d==1) R '.';
        if (d==2) R ',';
        if (d==3) R '!';
        if (d==4) R '?';
        if (d==0) R ' ';
    case 2:
        d=cnt%3;
        if (d==1) R 'a';
        if (d==2) R 'b';
        if (d==0) R 'c';
    case 3:
        d=cnt%3;
        if (d==1) R 'd';
        if (d==2) R 'e';
        if (d==0) R 'f';
    case 4:
        d=cnt%3;
        if (d==1) R 'g';
        if (d==2) R 'h';
        if (d==0) R 'i';
    case 5:
        d=cnt%3;
        if (d==1) R 'j';
        if (d==2) R 'k';
        if (d==0) R 'l';
    case 6:
        d=cnt%3;
        if (d==1) R 'm';
        if (d==2) R 'n';
        if (d==0) R 'o';
    case 7:
        d=cnt%4;
        if (d==1) R 'p';
        if (d==2) R 'q';
        if (d==3) R 'r';
        if (d==0) R 's';
    case 8:
        d=cnt%3;
        if (d==1) R 't';
        if (d==2) R 'u';
        if (d==0) R 'v';
    case 9:
        d=cnt%4;
        if (d==1) R 'w';
        if (d==2) R 'x';
        if (d==3) R 'y';
        if (d==0) R 'z';
    }
}

int main()
{
    int n, c, p;
    string s, ans[200]={};
    cin>>n;
    for (int i=0; i<n; i++)
    {
        c=0; p=0;
        cin>>s;
        for (int j=0; j<s.size(); j++)
        {
            if (s[j]=='0' && p!=0) { ans[i]+=convert(c, p); c=0; p=0; }
            if (s[j]=='0' && p==0) { c=0; }
            else if (s[j]==p) { c++; }
            else { p=s[j]-48; c++; }
        }
    }
    for (int i=0; i<n; i++) cout<<ans[i]<<'\n';
    R 0;
}