Advertisement
Blagovest

ReverseArrayOfIntegers

Jul 27th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace loops
  8. {
  9. class loops
  10. {
  11. static void Main(string[] args)
  12. {
  13. int n = int.Parse(Console.ReadLine());
  14. int[] arr = new int[n];
  15. for (int i = 0; i < n; i++)
  16. {
  17. arr[i] = int.Parse(Console.ReadLine());
  18. }
  19.  
  20. for (int i = arr.Length-1; i >= 0; i--)
  21. {
  22. Console.Write(arr[i]);
  23. if (i>0)
  24. Console.Write(' ');
  25. else
  26. Console.WriteLine();
  27.  
  28. }
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement