Advertisement
optybg

Untitled

Feb 21st, 2017
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.81 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5.  
  6. namespace FlipListSides_4
  7. {
  8.     public class FlipListSides_4
  9.     {
  10.         public static void Main()
  11.         {
  12.             var input = Console.ReadLine();
  13.             var intList = new List<int>(input
  14.                 .Split()
  15.                 .Select(int.Parse)
  16.                 .ToList()
  17.                 );
  18.            
  19.             for (int i = 0; i < (intList.Count/2); i++)
  20.             {
  21.                 if (i!=0)
  22.                 {
  23.                     var temp = intList[i];
  24.                     intList[i] = intList[(intList.Count) - i -1];
  25.                     intList[(intList.Count) - i -1] = temp;
  26.                 }
  27.                
  28.             }
  29.  
  30.             Console.WriteLine(string.Join(" ", intList));
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement