题解 | #记负均正#
记负均正
http://www.nowcoder.com/practice/6abde6ffcc354ea1a8333836bd6876b8
let str; while(str = parseInt(readline())){ let lessZefo = 0,aver=0; let num = readline(); let arr = num.split(' ') for(let v of arr){ if(parseInt(v) < 0){ lessZefo++ } } let newArr = arr.filter((v)=>{ return v>0; }) let sum = newArr.reduce((pre,cur)=>{ return pre+cur*1; },0) console.log(lessZefo,(sum/newArr.length).toFixed(1) ) }