每次输⼊两个复数,每个复数均包括由空格分隔的两个浮点数,输⼊第⼀个复数后,键⼊回⻋,然后继续输⼊第⼆个复数。 2 o" B( @6 ^9 K. g; L, g 输出两个复数,每个复数占⼀⾏;复数是由⼩括号包围的形如 (a+bi) 的格式。注意不能输出全⻆括号。 + Z* h& {/ S" W# |! G4 X样例输⼊% e3 z2 G* l5 C9 H5 z& x X- i+ _7 p
14 f" F. D2 ]1 t" [' Z: M, @7 \
2/ `4 p7 q. H! }% U8 `
-1.1 2.0 9 C Q' r0 Z" U$ T 0 -4.5 # {+ J- O6 C) z* D7 b2 _2 p样例输出 4 c* a: G; [" o& k( p: z# t" `19 _- R. c3 C6 y6 Q. E- H
28 L* z7 Z# W( ]
3 - q0 Y4 b( s% v0 \( U4 E/ q% X% V5 P, N1 g
5) x$ G- R* I3 r8 w; J8 g
(-1.1+2i) (0-4.5i): J$ H( v1 o. a* J' \5 z4 j
(-1.1-2.5i), c9 H7 n. z+ _. F( V( W. q0 s# E
(-1.1+6.5i) 4 U6 N* X1 H" l( b( V(9+4.95i) " ^( I8 N2 w. Z(-0.444444-0.244444i) ( k0 f# J' M: ^, `- v提示/ B1 y( R( {- }. T# M# t/ Y
需要注意,复数的四则运算定义如下所示: 2 {0 f0 K% E% Q
加法法则: ( a + b i ) + ( c + d i ) = ( a + c ) + ( b + d ) i (a + bi) + (c + di) = (a + c) + (b + d)i (a+bi)+(c+di)=(a+c)+(b+d)i
减法法则: ( a + b i ) − ( c + d i ) = ( a − c ) + ( b − d ) i (a + bi) − (c + di) = (a − c) + (b − d)i (a+bi)−(c+di)=(a−c)+(b−d)i
乘法法则: ( a + b i ) × ( c + d i ) = ( a c − b d ) + ( b c + a d ) i (a + bi) × (c + di) = (ac − bd) + (bc + ad)i (a+bi)×(c+di)=(ac−bd)+(bc+ad)i
除法法则: ( a + b i ) ÷ ( c + d i ) = [ ( a c + b d ) / ( c 2 + d 2 ) ] + [ ( b c − a d ) / ( c 2 + d 2 ) ] i (a + bi) ÷ (c + di) = [(ac + bd)/(c^2 + d^2 )] + [(bc − ad)/(c^2 + d^2)]i (a+bi)÷(c+di)=[(ac+bd)/(c2+d2)]+[(bc−ad)/(c2+d2)]i" k' E3 X# \5 Q1 w* g/ X* w