Advertisement
Guest User

Deciphering

a guest
Apr 6th, 2019
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3.  
  4. namespace _02._Deciphering
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. string input = Console.ReadLine();
  11. string[] comand = Console.ReadLine().Split(" ");
  12. int count = 0;
  13. for (int i = 0; i < input.Length; i++)
  14. {
  15. if (!((input[i] >= 100 && input[i] <= 125) || input[i] == 35))
  16. {
  17. Console.WriteLine("This is not the book you are looking for.");
  18. return;
  19. }
  20. count++;
  21. }
  22. StringBuilder result = new StringBuilder();
  23. for (int j = 0; j < input.Length; j++)
  24. {
  25. result.Append((char)((int)input[j] - 3));
  26. }
  27. result = result.Replace(comand[0], comand[1]);
  28. Console.WriteLine(result);
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement