function Main(input) { var input = input.split("\n")[0].split(","); var result = (() => { count = 0; input.map(function(value) { count = count + Number(value)}); return "合計点:" + count + "\n平均点:" + (count / 3).toFixed(1); })(); console.log(result); } Main(require("fs").readFileSync("/dev/stdin", "utf8"));