代码展示:
# 3 4 -5 2 6 1 -2 0
# 12 3 -10 1 6 0
data = list(map(eval,input().split()))
result = list()
i = 0
while i < len(data)-1:
coef, exp, = data[i]*data[i+1], data[i+1]-1
if coef != 0:
result.append(coef)
result.append(exp)
i+=2
if len(result) == 0:
result = [0,0]
result = list(map(str,result))
print(" ".join(result))
测评结果: