We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
#include<bits/stdc++.h>usingnamespacestd;intmain(){ios_base::sync_with_stdio(0),cin.tie(0);//optimization line :)intt;cin>>t;vector<int>arr(t);// create the array of size tfor(inti=0;i<t;i++){cin>>arr[i];// fill the values of the array}reverse(arr.begin(),arr.end());//use reverse to reverse the order of the arrayfor(inti=0;i<t;i++){cout<<arr[i]<<" ";//print the array values}return0;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Arrays Introduction
You are viewing a single comment's thread. Return to all comments →