Skip to content

Instantly share code, notes, and snippets.

@breakstorm
Created February 14, 2017 03:21
Show Gist options
  • Save breakstorm/774009e1de3bbb34f703ebc5f43fde63 to your computer and use it in GitHub Desktop.
Save breakstorm/774009e1de3bbb34f703ebc5f43fde63 to your computer and use it in GitHub Desktop.
process.stdin.resume();
process.stdin.setEncoding('ascii');
var input_stdin = "";
var input_stdin_array = "";
var input_currentline = 0;
process.stdin.on('data', function (data) {
input_stdin += data;
});
process.stdin.on('end', function () {
input_stdin_array = input_stdin.split("\n");
main();
});
function readLine() {
return input_stdin_array[input_currentline++];
}
/////////////// ignore above this line ////////////////////
function main() {
var n = parseInt(readLine());
arr = readLine().split(' ');
arr = arr.map(Number);
tempArr = [];
tempString = "";
for(i=n-1; i >= 0; i--){
//console.log(arr[i]);
//document.write(arr[i]);
//tempArr.push(arr[i]);
tempString = tempString + arr[i] + " ";
}
//console.log(tempArr);
console.log(tempString);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment