Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.31 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.  
  7. namespace asciiart
  8. {
  9.     class Solution
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string[,] letters;
  14.  
  15.             int L = int.Parse(Console.ReadLine());
  16.             int H = int.Parse(Console.ReadLine());
  17.             letters = new string[27,H];
  18.             string T = Console.ReadLine();
  19.  
  20.             T = T.ToUpper();
  21.  
  22.             for (int i = 0; i < H; i++)
  23.             {
  24.                 string Row = Console.ReadLine();
  25.                 for (int j = 0; j < 27; j++)
  26.                 {
  27.                     letters[j, i] = Row.Substring(j * L, L);
  28.                 }
  29.             }
  30.  
  31.             for (int i = 0; i < H; i++)
  32.             {
  33.                 string Result = "";
  34.                 for (int j = 0; j < T.Length; j++)
  35.                 {
  36.                     int k = ((int)T[j] - (int)'A');
  37.                     if (k >= 0 && k <= 25) {
  38.                         Result = Result + letters[k, i];
  39.                     } else
  40.                     {
  41.                         Result = Result + letters[26, i];
  42.                     }
  43.                 }
  44.                 Console.WriteLine(Result);
  45.             }
  46.  
  47.             Console.ReadLine();
  48.         }
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement