Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _05._Messages
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- int komands = int.Parse(Console.ReadLine());
- string text = "";
- int count = 0;
- for (int i = 0; i < komands; i++)
- {
- int number = int.Parse(Console.ReadLine());
- int symbol = number % 10;
- if (symbol == 0)
- {
- text += " ";
- }
- else if (symbol == 2)
- {
- while (number > 0)
- {
- number /= 10;
- count++;
- }
- if (count == 1) { text += "a"; }
- else if (count == 2) { text += "b"; }
- else if (count == 3) { text += "c"; }
- count = 0;
- }
- else if (symbol == 3)
- {
- while (number > 0)
- {
- number /= 10;
- count++;
- }
- if (count == 1) { text += "d"; }
- else if (count == 2) { text += "e"; }
- else if (count == 3) { text += "f"; }
- count = 0;
- }
- else if (symbol == 4)
- {
- while (number > 0)
- {
- number /= 10;
- count++;
- }
- if (count == 1) { text += "g"; }
- else if (count == 2) { text += "h"; }
- else if (count == 3) { text += "i"; }
- count = 0;
- }
- else if (symbol == 5)
- {
- while (number > 0)
- {
- number /= 10;
- count++;
- }
- if (count == 1) { text += "j"; }
- else if (count == 2) { text += "k"; }
- else if (count == 3) { text += "l"; }
- count = 0;
- }
- else if (symbol == 6)
- {
- while (number > 0)
- {
- number /= 10;
- count++;
- }
- if (count == 1) { text += "m"; }
- else if (count == 2) { text += "n"; }
- else if (count == 3) { text += "o"; }
- count = 0;
- }
- else if (symbol == 7)
- {
- while (number > 0)
- {
- number /= 10;
- count++;
- }
- if (count == 1) { text += "p"; }
- else if (count == 2) { text += "q"; }
- else if (count == 3) { text += "r"; }
- else if (count == 4) { text += "s"; }
- count = 0;
- }
- else if (symbol == 8 )
- {
- while (number > 0)
- {
- number /= 10;
- count++;
- }
- if (count == 1) { text += "t"; }
- else if (count == 2) { text += "u"; }
- else if (count == 3) { text += "v"; }
- count = 0;
- }
- else if (symbol == 9)
- {
- while (number > 0)
- {
- number /= 10;
- count++;
- }
- if (count == 1) { text += "w"; }
- else if (count == 2) { text += "x"; }
- else if (count == 3) { text += "y"; }
- else if (count == 4) { text += "z"; }
- count = 0;
- }
- }
- Console.WriteLine(text);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement