Advertisement
YavorGrancharov

Flip_List_Sides

Jun 24th, 2017
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace Flip_List_Sides
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.             List<int> list = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
  12.  
  13.             list.Reverse(list.IndexOf(list[1]), list.IndexOf(list[list.Count - 2]));
  14.  
  15.             Console.WriteLine(string.Join(" ", list));
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement