fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace ConsoleApplication1
  6. {
  7. class Program
  8. {
  9. static void Main(string[] args)
  10. {
  11. string enc = "tett rett nete tsvn wnyh este brwn yeez";
  12. var table = Enumerable.Range('d', 'z' - 'd' + 1)
  13. .Select(i => (char)i)
  14. .Zip(Enumerable.Range('a', 'w' - 'a' + 1).Select(i => (char)i),
  15. (f, s) => new KeyValuePair<char, char>(f, s)
  16. )
  17. .Concat(Enumerable.Range('a', 'c' - 'a' + 1)
  18. .Select(i => (char)i)
  19. .Zip(Enumerable.Range('x', 'z' - 'x' + 1).Select(i => (char)i),
  20. (f, s) => new KeyValuePair<char, char>(f, s)
  21. )
  22. );
  23. foreach (var item in table)
  24. {
  25. enc = enc.Replace(item.Key, item.Value);
  26. }
  27. Console.WriteLine(enc);
  28. }
  29. }
  30. }
  31.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty