牛客网:
1. 单行输入:
while(line=readline()){ var lines = line.split(‘ ‘); var a = parseInt(lines[0]); var b = parseInt(lines[1]); print(a+b); }
2. 两行输入,单行输出:
var n; while(n=parseInt(readline())){ var marr = readline().split(‘ ‘); print(fun(marr, n)); } function fun(){ .... }
3. 多行输入, 单行输出:
4. 多行输入, 多行输出:
原文:http://www.cnblogs.com/ariel-zhang/p/7203417.html