백준 1546 Node1 [백준] 1546 Node.js const fs = require('fs'); const [n, ...arr] = fs.readFileSync("/dev/stdin").toString().trim().split(/\s/); const scores = arr.map(Number) const MAX = Math.max(...scores) let avg = 0; scores.forEach((s, i) => { scores[i] = (s/MAX)*100 avg += scores[i]; }) console.log(avg/Number(n)) 2022. 9. 25. 이전 1 다음