Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Intro_and_Basic_Syntax
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             var iter = int.Parse(Console.ReadLine().Trim());
  13.             var number = 0;
  14.             var main = 0;
  15.             var count = 0;
  16.             var lc = 0;
  17.             var fL ='a';
  18.             var text = string.Empty;
  19.  
  20.             for (int it = 0; it < iter; it++)
  21.             {
  22.                 count = 0;
  23.                 number = int.Parse(Console.ReadLine().Trim());
  24.                 main = number % 10;
  25.                 if (main != 0)
  26.                 {
  27.                     if (main <= 7)
  28.                     {
  29.                         fL = (char)('a' + ((main - 2) * 3));
  30.                     }
  31.                     else
  32.                     {
  33.                         fL = (char)('a' + 1 + ((main - 2) * 3));
  34.                     }
  35.                     lc = number.ToString().Length;
  36.                     for (int i = 0; i < lc; i++)
  37.                     {
  38.                         count += number % 10;
  39.                         number = number / 10;
  40.                     }
  41.                     count = count / main;
  42.                     fL = (char)(fL - 1 + count);
  43.                 }
  44.                 else
  45.                 {
  46.                     fL = ' ';
  47.                 }
  48.                 
  49.                 text = text + fL;
  50.             }
  51.             
  52.             Console.WriteLine(text);
  53.         }
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement