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<bits/stdc++.h>
using namespace std;

int main(void){

    vector<vector<char> > number(10);
    number[1].push_back('.');
    number[1].push_back(',');
    number[1].push_back('!');
    number[1].push_back('?');
    number[1].push_back(' ');

    number[2].push_back('a');
    number[2].push_back('b');
    number[2].push_back('c');

    number[3].push_back('d');
    number[3].push_back('e');
    number[3].push_back('f');

    number[4].push_back('g');
    number[4].push_back('h');
    number[4].push_back('i');

    number[5].push_back('j');
    number[5].push_back('k');
    number[5].push_back('l');

    number[6].push_back('m');
    number[6].push_back('n');
    number[6].push_back('o');

    number[7].push_back('p');
    number[7].push_back('q');
    number[7].push_back('r');
    number[7].push_back('s');

    number[8].push_back('t');
    number[8].push_back('u');
    number[8].push_back('v');

    number[9].push_back('w');
    number[9].push_back('x');
    number[9].push_back('y');
    number[9].push_back('z');    

    int n; cin >> n;
    for(int i = 0; i < n; i++){
        string str; cin >> str;
        int j = 0;
        while(str[j] != '\0'){
            int counter = 0;
            if(str[j] == '0'){ 
                j++;
                continue;
            }
            while(str[j] != '0'){
                counter++;
                j++;
            }
            //cout << j - 1 << endl;
            //cout << str[j - 1] << endl;
            //int a = str[j - 1];
            //cout << counter << endl;
            //cout << a << endl;
            //cout << number[ a ].size() << endl;
            //cout << number[2].size() << endl;
            //cout << counter / number[j - 1].size() << endl;
            //cout << counter << " " << str[j - 1] << endl;
            cout << number[(int)str[j - 1] - '0'][(counter-1) % number[(int)str[j - 1] - '0'].size()];
            j++;
        }

        cout << endl;
    }

    return 0;
}

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

int main() {
    vector<vector<char>> v = { {'.', ',', '!', '?', ' '},
                               {'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 n;
    cin >> n;
    for(int i=0; i<n; ++i) {
        string str;
        cin >> str;
        int counter = -1;
        int id = -1;
        for(int j=0; j<str.size(); ++j) {
            char c = str[j];
            if(c == '0' && id != -1) {
                cout << v[id][counter];
                id = -1;
                counter = -1;
            } else if(c != '0') {
                id = static_cast<int>(c - '0' - 1);
                counter = (counter+1)%v[id].size();
            }
        }
        cout << endl;
    }
}

C++: #include <bits/stdc++.h>

using namespace std;

int main(void){
	vector<vector<string>> moji{
		{}, 
		{".",",","!","?"," "},
		{"a","b","c"},
		{"d","e","f"},
		{"f","h","i"},
		{"j","k","l"},
		{"m","n","o"},
		{"p","q","r","s"},
		{"t","u","v"},
		{"w","x","y","z"}
	};

	int num;
	cin >> num;
	for(int i = 0; i < num; i++){
		int count = 0;
		string str;
		cin >> str;
		string one = "0";

		for(int j = 0; j < str.size(); j++){
			if(str[j] == '0'){
				if(one != "0"){
					count--;
					cout << moji[stoi(one)][count % moji[stoi(one)].size()];
				}
				one = str[j];
				count = 0;
			}else{
				one = str[j];
				count++;
			}
		}
		cout << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main() {
	int n; cin >> n;
	string s[10];
	s[0] = '0';
	s[1] = ".,!? ";
	s[2] = "abc";
	s[3] = "def";
	s[4] = "ghi";
	s[5] = "jkl";
	s[6] = "mno";
	s[7] = "pqrs";
	s[8] = "tuv";
	s[9] = "wxyz";
	for (int i = 0; i < n; i++) {


		string num;
		cin >> num;
		for (int j = 0; j < num.size(); j++) {
			if (j == 0) {
				if (num[j] == '0') {
					continue;
				}
			}

			else if (num[j - 1] == '0'&&num[j] == '0') {
				continue;
			}
			int t = 0;
			while (num[j + t] != '0')t++;
			switch (num[j]) {
			case '1':cout << s[1][(t - 1) % 5]; break;
			case '2':
			case '3':
			case '4':
			case '5':
			case '6':cout << s[num[j] - '0'][(t - 1) % 3]; break;
			case '7':cout << s[7][(t - 1) % 4]; break;
			case '8':cout << s[num[j] - '0'][(t - 1) % 3]; break;
			case '9':cout << s[9][(t - 1) % 4]; break;
			default:break;
			}
			j += t;
		}
		cout << endl;






	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <cstdlib>
#include <sstream>
using namespace std;
int main(){
	int N;
	cin >> N;
	for(int i=0;i<N;i++){
		string key[]={".,!?, ","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};
		string input;
		cin>>input;
		stringstream b(input);
		int num=0,count=0;
		while(1){
			char c;
			if(b>>c)break;
			int input=c-'0';
			if(input!=0){
				count++;
				num=input;
			}
			else {
				if(count!=0)
					count<<key[num-1][count%key[num-1].size()];
				num=0;count=0;
			}
		}
		cout<<endl;
	}
	return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
string c[11] = {"",
		".,!? ",
		"abc",
		"def",
		"ghi",
		"jkl",
		"mno",
		"pqrs",
		"tuv",
		"wxyz"};
int main(void){
  int n;
  cin >> n;
  string s;
  for(int i = 0; i < n; i++){
    string res;
    cin >> s;
    char a = '0';
    int b = 0;
    for(int j = 0; j < (int)s.size(); j++){
      if(s[j] == a){
	b++;
      }else{
	if(a-'0')
	  res += c[a-'0'][b%(int)c[a-'0'].size()];
	a = s[j];
	b = 0;
      }
    }
    cout << res << endl;
  }
}