代码展示:
from math import sin,cos
R1, P1, R2, P2 = list(map(eval,input().split()))
# R1, P1, R2, P2 = 2.3, 3.5, 5.2, 0.4
c1 = R1 * complex(cos(P1),sin(P1))
c2 = R2 * complex(cos(P2),sin(P2))
res = c1*c2
# print(res.real,res.imag)
if res.imag < 0:
print('{0:.2f}-{1:.2f}i'.format(res.real,abs(res.imag)))
else:
print('{0:.2f}+{1:.2f}i'.format(res.real,res.imag))
测评结果: