You are viewing a single comment's thread. Return to all comments →
int main() { int n; cin >> n; int list[n]; for (int i=1; i<=n; i++){ cin >> list[i - 1]; } for (int i=n; i>0;i--){ cout << list[i-1] << " "; } return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Arrays Introduction
You are viewing a single comment's thread. Return to all comments →
int main() { int n; cin >> n; int list[n]; for (int i=1; i<=n; i++){ cin >> list[i - 1]; } for (int i=n; i>0;i--){ cout << list[i-1] << " "; } return 0; }