Hackerrank C++ -------- Array Introduction
#include <iostream>
using namespace std;
int main(){
int n , arr[1000] , i , j , g ;
cin>> n ;
g = n ;
for ( i = 0 ; i<n ; i++) {
cin >> arr[i] ;
}
for ( j = g-1 ; j >= 0 ; j-- ){
cout << arr[j] << " " ;
}
return 0;
}
Comments
Post a Comment