lol-io
Codeforces uses d8 for testing javascript code. d8 provides IO functions, but if you don't want install d8 and you want testing your solutions using node.js then you can use this module
If you want try d8 you can download it compiled for windows here
Post about js on codeforces http://codeforces.com/blog/entry/10024
Discussing on codeforces http://codeforces.com/blog/entry/57807
When you use this library, your code is valid for submitting to codeforces
Example
var print = thisprint || printvar write = thiswrite || writevar readline = thisreadline || readline// a + bconst s = ;
Installation
This is a Node.js module available through the npm registry.
Before installing, download and install Node.js.
Installation is done using the
npm install
command:
$ npm install lol-io
Functions
write
- write line intooutput.txt
, examplewrite('hello', 'world')
print
- write line intooutput.txt
, automatically prints new line, exampleprint('hello', 'world')
readline
- read line frominput.txt
, examplevar line = readline()
, if no more lines returnundefined
Features
- automatic creation of
input.txt
andoutput.txt
, if does not exist