Advertisement
yani-valeva

MirrorImage

Jul 5th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. public class MirrorImage
  6. {
  7. public static void Main()
  8. {
  9. List<string> elements = Console.ReadLine().Split().ToList();
  10. string input = Console.ReadLine();
  11.  
  12. while (!input.Equals("Print"))
  13. {
  14. int index = int.Parse(input);
  15. elements.Reverse(0, index);
  16. elements.Reverse(index + 1, elements.Count - 1 - index);
  17.  
  18. input = Console.ReadLine();
  19. }
  20.  
  21. Console.WriteLine(string.Join(" ", elements));
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement