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<cstdio>
#include<cstring>
using namespace std;
int main(){   
  char m[9][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 a,count=0,c[100],d;
  char b[100][1024];
  cin>>a;
  for(int i=0;i<a;i++){
    scanf("%s",b[i]);
    c[i]=strlen(b[i]);
    for(int j=0;j<c[i];j++){

      if(b[i][j]!='0'){
	count++;
	d=(int)(b[i][j])-48;
      }
      else{
	if(b[i][j-1]!=0){
	  if(d==1)
	    if(count%5==0)
	      cout<<m[d-1][4];
	    else 
	      cout<<m[d-1][count%5-1];
	  
	  else if(d==7 || d==9)
	    if(count%4==0)
	      cout<<m[d-1][3];
	    else
	      cout<<m[d-1][count%4-1];
	  
	  else
	    if(count%3==0)
	      cout<<m[d-1][2];
	    else
	      cout<<m[d-1][count%3-1];
	  count=0;
	}
      }
    }
    cout<<endl;
  }
  return 0;
}

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

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

int main(){
    int N;
    char mes[80];
    for(scanf("%d", &N); N--;){
        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;
}

C++: #include<bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n ; i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define whole(f, x, ...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x) // decltypeで型取得、引数があればva_argsのところに入れる
using namespace std;
typedef long long ll; // long longをllでかけるようにした
const int INF = 1e9;

int main(void){
    int num; cin >> num;
    for(int n; n < num; n++){
        string number; cin >> number;
        REP(i, number.size()){
            char out;
            int kai = 0;
            if(number[i] == '1'){
                while(number[i] != '0'){
                    kai++;
                    if(kai == 6) kai = 1;
                    if(kai == 1) out = '.';
                    else if(kai == 2) out = ',';
                    else if(kai == 3) out = '!';
                    else if(kai == 4) out = '?';
                    else if(kai == 5) out = ' ';
                    i++;
                }
                cout << out;
            }
            if(number[i] == '2'){
                while(number[i] != '0'){
                    kai++;
                    if(kai == 4) kai = 1;
                    if(kai == 1) out = 'a';
                    else if(kai == 2) out = 'b';
                    else if(kai == 3) out = 'c';
                    i++;
                }
                cout << out;
            }
            if(number[i] == '3'){
                while(number[i] != '0'){
                    kai++;
                    if(kai == 4) kai = 1;
                    if(kai == 1) out = 'd';
                    else if(kai == 2) out = 'e';
                    else if(kai == 3) out = 'f';
                    i++;
                }
                cout << out;
            }
            if(number[i] == '4'){
                while(number[i] != '0'){
                    kai++;
                    if(kai == 4) kai = 1;
                    if(kai == 1) out = 'g';
                    else if(kai == 2) out = 'h';
                    else if(kai == 3) out = 'i';
                    i++;
                }
                cout << out;
            }
            if(number[i] == '5'){
                while(number[i] != '0'){
                    kai++;
                    if(kai == 4) kai = 1;
                    if(kai == 1) out = 'j';
                    else if(kai == 2) out = 'k';
                    else if(kai == 3) out = 'l';
                    i++;
                }
                cout << out;
            }
            if(number[i] == '6'){
                while(number[i] != '0'){
                    kai++;
                    if(kai == 4) kai = 1;
                    if(kai == 1) out = 'm';
                    else if(kai == 2) out = 'n';
                    else if(kai == 3) out = 'o';
                    i++;
                }
                cout << out;
            }
            if(number[i] == '7'){
                while(number[i] != '0'){
                    kai++;
                    if(kai == 5) kai = 1;
                    if(kai == 1) out = 'p';
                    else if(kai == 2) out = 'q';
                    else if(kai == 3) out = 'r';
                    else if(kai == 4) out = 's';
                    i++;
                }
                cout << out;
            }
            if(number[i] == '8'){
                while(number[i] != '0'){
                    kai++;
                    if(kai == 4) kai = 1;
                    if(kai == 1) out = 't';
                    else if(kai == 2) out = 'u';
                    else if(kai == 3) out = 'v';
                    i++;
                }
                cout << out;
            }
            if(number[i] == '9'){
                while(number[i] != '0'){
                    kai++;
                    if(kai == 5) kai = 1;
                    if(kai == 1) out = 'w';
                    else if(kai == 2) out = 'x';
                    else if(kai == 3) out = 'y';
                    else if(kai == 4) out = 'z';
                    i++;
                }
                cout << out;
            }
        }
        cout << endl;
    }
}

C++: #include<iostream>
#include<string>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)

string in;
int j = 0;
int index = -1;

string c_1 = ".,!? " ;
string c_2 = "abc";
string c_3 = "def";
string c_4 = "ghi";
string c_5 = "jkl";
string c_6 = "mno";
string c_7 = "pqrs";
string c_8 = "tuv";
string c_9 = "wxyz";

char func(string s)
{
	while (in[j] != '0')
	{
		index++;
		if (index >= s.size())index = 0;
		j++;
	}
	return s[index];
}

int main()
{
	int n;
	cin >> n;
	cin.ignore();
	REP(i, n)
	{
		in.clear();
		getline(cin, in);
		j = 0;
		while (in[j] != '\0')
		{
			index = -1;
			switch (in[j])
			{
			case '1':
				cout << func(c_1);
				break;
			case '2':
				cout << func(c_2);
				break;
			case '3':
				cout << func(c_3);
				break;
			case '4':
				cout << func(c_4);
				break;
			case '5':
				cout << func(c_5);
				break;
			case '6':
				cout << func(c_6);
				break;
			case '7':
				cout << func(c_7);
				break;
			case '8':
				cout << func(c_8);
				break;
			case '9':
				cout << func(c_9);
				break;
		    }
			j++;
		}
		cout << endl;
	}
	return 0;
}