题解 | #记负均正II#
记负均正II
https://www.nowcoder.com/practice/64f6f222499c4c94b338e588592b6a62
const rl = require("readline").createInterface({ input: process.stdin }); var iter = rl[Symbol.asyncIterator](); const readline = async () => (await iter.next()).value; let sum = 0; let countplus = 0 let count = 0; void async function () { // Write your code here while(line = Number(await readline())){ if(line>0){ sum+=line; countplus++ }else { count++ } } console.log(count) console.log(countplus>0? (sum/countplus).toFixed(1):"0.0"); }()