每次输⼊两个复数,每个复数均包括由空格分隔的两个浮点数,输⼊第⼀个复数后,键⼊回⻋,然后继续输⼊第⼆个复数。 9 M7 r% g" y# ]$ v 输出两个复数,每个复数占⼀⾏;复数是由⼩括号包围的形如 (a+bi) 的格式。注意不能输出全⻆括号。 - }- Y, ?4 O# m: _1 N样例输⼊' y" k, `; ]7 q; e% N
1$ j& L& s" F" {
2 0 n. y0 V. ^& j-1.1 2.0+ r8 U ?8 F- e: u8 h; ^
0 -4.55 C- B5 Q" X$ J4 T" ]/ b3 r
样例输出 $ [: M) e& A3 s1. u5 s0 |! R+ C3 ^5 s0 ^
25 Y$ H# ^2 H$ K6 T
38 m7 N# y3 s7 ?. v6 C. R7 A& J
4 ' y0 ^, u$ |* ~( |) E( \1 p5 7 i. _" T+ b9 v0 m(-1.1+2i) (0-4.5i)% Y+ J! | ^# n z! w1 s9 i
(-1.1-2.5i)1 w* N: @/ C3 Y* b
(-1.1+6.5i) # e, I V5 g3 p/ y8 w! a8 ^(9+4.95i)2 o6 _% c' N3 a5 G$ M& v2 g1 C7 |
(-0.444444-0.244444i)( ^6 I2 w! r& Q& F! M# C4 T: r
提示/ A' J2 h, H( Y) n
需要注意,复数的四则运算定义如下所示:% x7 ]* }$ d+ x* Q, n
加法法则: ( 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! \# p# [3 H6 E0 @