Advertisement
MapTuH

Untitled

Oct 22nd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. namespace _02.Icarus
  2. {
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6.  
  7. public class Icarus
  8. {
  9. public static void Main()
  10. {
  11. var input = Console.ReadLine();
  12. while (input != "Hornet is Green")
  13. {
  14. var index= input.IndexOf("<->");
  15. var left = input.Substring(0, index);
  16. var right = input.Substring(index+5);
  17. if (left.ToCharArray().All(l => char.IsDigit(l)) &&
  18. right.ToCharArray().All(r => char.IsLetterOrDigit(r)))
  19. {
  20. for (int i = index; i > 0; i--)
  21. {
  22. left = left[i].ToString();
  23. }
  24. Console.WriteLine(left);
  25. Console.WriteLine(right);
  26. }
  27. input = Console.ReadLine();
  28. }
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement