Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. static void Main(string[] args)
  2. {
  3. int L = int.Parse(Console.ReadLine());
  4. int H = int.Parse(Console.ReadLine());
  5. string T = Console.ReadLine().ToUpper();
  6. string abc="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  7.  
  8. for (int i = 0; i < H; i++)
  9. {
  10. string ROW = Console.ReadLine();
  11. string output="";
  12. for (int k=0; k< T.Length; k++)
  13. {
  14. int charPosition=abc.IndexOf(T[k]);
  15. if (charPosition !=-1)
  16. {
  17. int start = L*charPosition;
  18. int end = start + L;
  19. for (int j=start; j<end; j++)
  20. {
  21. output+=ROW[j];
  22. }
  23. }
  24. else
  25. {
  26. for (int j=ROW.Length-L; j<ROW.Length; j++)
  27. {
  28. output+=ROW[j];
  29. }
  30. }
  31. }
  32. Console.WriteLine(output);
  33. }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement