Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace P05_Messages
- {
- class Program
- {
- static void Main(string[] args)
- {
- int tapTimes = int.Parse(Console.ReadLine());
- string message = "";
- for (int i = 1; i <= tapTimes; i++)
- {
- int input = int.Parse(Console.ReadLine());
- int lenght = input.ToString().Length;
- int mainDigit = input % 10;
- int offset = (mainDigit - 2) * 3;
- if(mainDigit==8 || mainDigit==9)
- {
- offset += 1;
- }
- int indexLetter = offset + lenght - 1;
- if(mainDigit != 0)
- {
- message += (char)(indexLetter + 97);
- }
- else
- {
- message += (char)(32);
- }
- }
- Console.WriteLine(message);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement