var buf = '';
var k;
var arr;
process.stdin.on('readable', function() {
var chunk = process.stdin.read();
if (chunk) buf += chunk.toString();
});
process.stdin.on('end', function() {
buf.split('n').forEach(function(line, i) {
// 第1行输入
if (i === 0) {
k = parseInt(line);
// 第2行输入
} else if (i === 1) {
arr = line.split(' ').map(function(x) { return parseInt(x); });
// 在这里使用输入作为参数运行测试程序
console.log(testFn(k, arr));
}
});
});
// 测试程序
function testFn() {
// 在这里编写测试程序
// ...
// 使用process.stdout.write或者console.log输出测试结果
console.log('测试成功');
}
---来自腾讯云社区的---Mr.Teen
微信扫一扫打赏
支付宝扫一扫打赏