Advertisement
Qrist

Print Numbers in Reverse Order

Apr 7th, 2020
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace GitHub
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             int n = int.Parse(Console.ReadLine());
  11.             int[] arr = new int[n];
  12.             for (int i = 0; i < n; i++)
  13.             {
  14.                 int num = int.Parse(Console.ReadLine());
  15.                 arr[i] = num;
  16.             }
  17.             for (int i = arr.Length-1; i >= 0; i--)
  18.             {
  19.                 Console.Write(arr[i]+ " ");
  20.             }          
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement