题目:
提交:
const number = readline()
const result = {}
for(let i = 0; i < Number(number); i++) {
let line = readline()
let arr = line.split(' ')
if (result[arr[0]]) {
result[arr[0]] = Number(result[arr[0]]) + Number(arr[1])
} else {
result[arr[0]] = arr[1]
}
}
for(let k in result) {
console.log(k + ' ' + result[k])
}