Advertisement
martinvalchev

Reverse_Array_of_Integers

Feb 6th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.57 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace Reverse_Array_of_Integers
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             int lenght = int.Parse(Console.ReadLine());
  11.             int[] arr = new int[lenght];
  12.  
  13.             for (int i = 0; i < arr.Length; i++)
  14.             {
  15.                 arr[i] = int.Parse(Console.ReadLine());
  16.             }
  17.  
  18.             int[] reversed = arr.Reverse().ToArray();
  19.             string result = string.Join(" ", reversed);
  20.  
  21.             Console.WriteLine(result);
  22.            
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement