#include #include #include char rotation[10][10] = { "", ".,!? ", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz" }; int main() { int N, I; int i, len; char s[1024]; int button, sequence; gets(s); N = atoi(s); for (I = 0; I < N; I++) { gets(s); len = strlen(s); button = sequence = -1; for (i = 0; i < len; i++) { if (s[i] == '0') { if (button > 0) { printf("%c", rotation[button][sequence % strlen(rotation[button])]); } button = sequence = -1; } else { button = s[i] - '0'; sequence++; } } printf("\n"); } return 0; }