解题思路:

1.用一个字典dic存取输入的index和value

2.判断 index 是否在字典dic的key中,不在字典中,直接dic[index] = value

3.index 在字典dic的key中,dic[index] += value