• + 0 comments
    C# code
    
    class Solution
    {
        public static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
    
            var rec = Console.ReadLine();
            if(rec != null)
            {
                List<int> arr = rec.TrimEnd().Split(' ').Reverse().ToList().Select(arrTemp => Convert.ToInt32(arrTemp)).ToList();
                
    //if you dont want to use foreach can use string.join ( string outPut = String.Join(" ", arr); )
            
                foreach(var data in arr)
                {
                    Console.Write(data+" ");
                }
            }
        }
    }