Last active
September 4, 2018 09:54
-
-
Save paladin3895/c34dccc83b442752b9d3cad59f9579a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
process.stdin.resume(); | |
process.stdin.setEncoding('utf8'); | |
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++]; | |
} | |
function print() { | |
console.log.apply(null, arguments); | |
} | |
/////////////// ignore above this line //////////////////// | |
function greeting() { | |
if (arguments.length > 0) { | |
return 'Hello ' + arguments[0]; | |
} | |
return 'Hello World'; | |
} | |
// this serve as main entry to implement your solution | |
function main() { | |
// write your code here. | |
// call `readLine()` to read a line. | |
// use print() to write to stdout | |
print( | |
greeting(readLine()) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment