[题解](续II)Let’s Celebrate the 100th Contest on ZOJ! » ZOJ3442

ZOJ3442
ZOJ3442.py


from __future__ import division
import sys
from cmath import *

arg = phase
real = lambda c: c.real
imag = lambda c: c.imag
conj = lambda c: c.conjugate()
gao = lambda f: 0 if abs(f) < 5e-7 else f
i = 1j
for line in sys.stdin:
	ans = eval(line)
	print "%+.6f%+.6f*i" % (gao(ans.real), gao(ans.imag))
Leave a Reply