How to read to the end of the file with JavaScript - Uri Online Judge

0

In% with% I'm using the uri online judge platform, however, I did not find anything about reading up to the EOF (End of File) in javascript.

Could anyone tell me how to read up to the EOF with javascript?

    
asked by anonymous 31.07.2018 / 17:20

1 answer

1

When you select JavaScript, the excerpt will appear for you:

var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var lines = input.split('\n');

/**
 * Escreva a sua solução aqui
 * Code your solution here
 * Escriba su solución aquí
 */

That reads the entire content of the entry, up to EOF and will divide by lines. You do not have to worry about it.

    
08.08.2018 / 18:14