一行代码解决问题,简单粗暴,还有谁????

console.log(Array.from(parseInt(readline()).toString(2)).filter(v=>v=='1').length)