JavaScript
Input: Standard Input (stdin)
Output: Standard Output (stdout)
Memory limit: 100 megabytes
Time limit: 1.0 seconds
Output: Standard Output (stdout)
Memory limit: 100 megabytes
Time limit: 1.0 seconds
I/O and Documentation
- We use Google's V8 interpreter to run JavaScript files.
- Use the
readline()
function to get input. - Use the
console.log()
function orprint()
function to write output. - You are permitted to view the MDN JavaScript Reference during an NZIC contest.
Example
Adding two numbers. Numbers will be space separated on a single line.
nums = readline().split(" ")
result = parseInt(nums[0]) + parseInt(nums[1])
console.log(result)
Submit
- Go to the submit tab and upload the addition program above by copy-pasting and selecting JavaScript in the language dropdown.
Testing
- Test out your own programs with Try It Online.
- You are permitted to use Try It Online for testing your programs during NZIC contests if JavaScript is your language of choice.
- The
readline
function returnsundefined
if the input does not end with a newline. Make sure you add one when testing your code with Try It Online. - Understanding submission feedback.
Sample Explanation
3 + 4 = 7
-
Sample Input 1
3 4
Sample Output 1
7