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<string>
using namespace std;

void bo(int,int);

void bo(int t,int m){
  if(t==1){
    if(m%5==1) cout<<".";
  else if(m%5==2) cout<<",";
  else if(m%5==3)cout<<"!";
  else if(m%5==4)  cout<<"?";
  else cout<<" ";
  }else if(t==2){
    if(m%3==1) cout<<"a";
    else if(m%3==2) cout<<"b";
    else cout<<"c";
  }else if(t==3){
    if(m%3==1) cout<<"d";
    else if(m%3==2) cout<<"e";
    else cout<<"f";
  }else if(t==4){
    if(m%3==1) cout<<"g";
    else if(m%3==2) cout<<"h";
    else cout<<"i";
  }else if(t==5){
    if(m%3==1) cout<<"j";
    else if(m%3==2) cout<<"k";
    else cout<<"l";
  }else if(t==6){
    if(m%3==1) cout<<"m";
    else if(m%3==2) cout<<"n";
    else cout<<"o";
  }else if(t==7){
    if(m%4==1) cout<<"p";
    else if(m%4==2) cout<<"q";
    else if(m%4==3) cout<<"r";
    else cout<<"s";
  }else if(t==8){
    if(m%3==1) cout<<"t";
    else if(m%3==2) cout<<"u";
    else cout<<"v";
  }else if(t==9){
    if(m%4==1) cout<<"w";
    else if(m%4==2) cout<<"x";
    else if(m%4==3) cout<<"y";
    else cout<<"z";
  }
}
		     
int main(){
  string str;
  int n;
  cin>>n;
  int cou=0;
  for(int i=0;i<n;i++){
  cin>>str;
  for(int j=0;j<str.size();j++){
    if( j>0 && str[j]=='0' ){
	bo(str[j-1]-'0',cou);
      cou=0;
      continue;
    }
    else if(str[j]!=0) cou++;
  }
  cout<<endl;
  }
  return 0;
}

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

using namespace std;

int main()
{
  char keitai[10][6] = {{'*', '*', '*', '*', '*', '*'},
                        {'.', ',', '!', '?', ' ', '*'},
                        {'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', '*', '*'},
  };
  string s;
  int x , c;
  char p;
  int n;
  cin >> n;
  cin.ignore();
  REP(k, n){
    getline(cin, s);
    x = c = 0;
    p = '\0';
    REP(i, s.size()){
      int j;
      j = s[i] - '0';
      if(j){
        if(x == j){
          if(keitai[j][c + 1] == '*'){
            c = 0;
            p = keitai[j][c];
          }else{
            c++;
            p = keitai[j][c];
          }
        }else{
          c = 0;
          p = keitai[j][c];
        }
      }else{
        if(p != '\0')
          cout << p;
        p = '\0';
      }
      x = j;
    }
    cout << endl;
  }
}

C++: #include <cstdio>
int main(){
  int N,p,g,a[9]={};
  int i,o;
  char v,prev;
  scanf("%d",&N);
  for(i=1;i<=N+1;i++){
    p=0;
    while(1){
      p++;
      scanf("%c",&v);
      if(v=='\n') break;
      if(v=='1') a[0]++;
      if(v=='2') a[1]++;
      if(v=='3') a[2]++;
      if(v=='4') a[3]++;
      if(v=='5') a[4]++;
      if(v=='6') a[5]++;
      if(v=='7') a[6]++;
      if(v=='8') a[7]++;
      if(v=='9') a[8]++;
      if(v=='0') {
	if(prev=='1') {
	  if(a[0]%5==4) printf("?");
	  if(a[0]%5==1) printf(".");
	  if(a[0]%5==2) printf(",");
	  if(a[0]%5==3) printf("!");
	  if(a[0]%5==0) printf(" ");
	}
	if(prev=='2'){
	  g=a[1]%3;
	  if(g==0) g=3;
	  printf("%c",96+g);
	}
	if(prev=='3'){
	  g=a[2]%3;
	  if(g==0) g=3;
	  printf("%c",99+g);
	}
	if(prev=='4'){
	  g=a[3]%3;
	  if(g==0) g=3;
	  printf("%c",102+g);
	}
	if(prev=='5'){
	  g=a[4]%3;
	  if(g==0) g=3;
	  printf("%c",105+g);
	}
	if(prev=='6'){
	  g=a[5]%3;
	  if(g==0) g=3;
	  printf("%c",108+g);
	}
	if(prev=='7'){
	  g=a[6]%4;
	  if(g==0) g=4;
	  printf("%c",111+g);
	}
	if(prev=='8'){
	  g=a[7]%3;
	  if(g==0) g=3;
	  printf("%c",115+g);
	}
	if(prev=='9'){
	  g=a[8]%4;
	  if(g==0) g=4;
	  printf("%c",118+g);
	}
	for(o=0;o<=8;o++){
	  a[o]=0;
	}
      } 
      prev=v;
    }
    if(i>=2)   printf("\n");
  }
  return 0;
}

C++: #define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };

ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
	vector<string> v(9);
	v[0] = ".,!? ";
	v[1] = "abc";
	v[2] = "def";
	v[3] = "ghi";
	v[4] = "jkl";
	v[5] = "mno";
	v[6] = "pqrs";
	v[7] = "tuv";
	v[8] = "wxyz";
	int T; cin >> T;
	while (T--) {
		string s; cin >> s;
		int _i = -1, _j = -1;
		for (int k = 0; k < s.length(); k++) {
			int i = s[k] - '0';
			if (i == 0) {
				if (_i != -1) {
					cout << v[_i][_j];
					_i = -1; _j = -1;
				}
			}
			else {
				_i = i - 1;
				_j = (_j + 1) % v[_i].length();
			}
		}
		cout << endl;
	}
}

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

char s[10][10] = {
  {},
  {'.', ',', '!', '?', ' '},
  {'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()
{
  int set;
  cin >> set;
  for(int cn = 0; cn < set; cn++)
  {
    string a;
    cin >> a;
    int n = 0;
    char c = '0';
    for(int i = 0; i < a.length(); i++)
    {
      if(a[i] != '0')
      {
        c = a[i];
        n++;
      }
      else
      {
        if(c != '0')
        {
          n--;
          int cc = c - '0';
          switch(cc)
          {
            case 0: break;
            case 1: cout << s[cc][n % 5]; break;
            case 2: case 3: case 4: case 5: case 6: case 8: cout << s[cc][n % 3]; break;
            case 7: case 9: cout << s[cc][n % 4]; break;
          }
        }
        n = 0;
        c = '0';
      }
    }
    cout << endl;
  }
}