-
Notifications
You must be signed in to change notification settings - Fork 5
/
P08_SmsTyping.cs
33 lines (31 loc) · 1014 Bytes
/
P08_SmsTyping.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
namespace P08_SmsTyping
{
class P08_SmsTyping
{
static void Main(string[] args)
{
string[][] smsTable = new string[][]
{
new string[]{" "},
new string[]{ },
new string[]{"a", "b","c"},
new string[]{"d","e","f"},
new string[]{"g","h","i"},
new string[]{"j","k","l" },
new string[]{"m","n","o"},
new string[]{"p","q","r","s"},
new string[]{"t","u","v" },
new string[]{"w","x","y","z" }
};
int characterCount = int.Parse(Console.ReadLine());
string outputSms = "";
for (int i = 0; i < characterCount; i++)
{
int charCode = int.Parse(Console.ReadLine());
outputSms += smsTable[charCode % 10][charCode.ToString().Length - 1];
}
Console.WriteLine(outputSms);
}
}
}