我尝试了这个操作,但是它给了我这样一个错误:syntaxerror:非法表达式for augmented assignment
。
输入内容如下:-2 4-1
x_forces, y_forces, z_forces = 0
x_forces, y_forces, z_forces += map(int, input().split(' '))
这就是你要找的吗?
x_forces, y_forces, z_forces = 0, 0, 0
n = [i for i in map(int, input().split(' '))]
x_forces += n[0]
y_forces += n[1]
z_forces += n[2]
print(x_forces, y_forces, z_forces)