-->
当前位置:首页 > 题库

PROGRAMMING:The plural

Luz5年前 (2021-05-10)题库457
Input two integers, representing the real part and imaginary part of the complex number, and require programming to output the appearance of the complex number composed of these two integers.
###Input format:
Two normal integers separated by spaces.
###Output format:
The complex output is in a pair of []. It is required that the output format should conform to the mathematical habits (of course, it can not be without the imaginary number mark I), such as: the real part or the imaginary part is zero, not output; When a single real part or imaginary part is positive, the front side does not output a positive sign; But when both of them are zero, they are [0]; When the imaginary part is negative, do not output more plus signs (for example: [- 3-4i] and [- 3 + - 4I]. The former is more in line with mathematical habits.
###Input example: 1
```in
18 -299
```
###Output sample 1:
```out
[18-299i]
```
###Input sample 2:
```in
0 999
```
###Output sample 2:
```out
[999i]
```






answer:If there is no answer, please comment