h4ex1: Structure, basic programming

h4ex1: Structure, basic programming

You cannot submit for this problem because the homework's deadline is due.

Description

A complex number is composed of a real part and of an imaginary part. Create a structure to represent complex numbers. Write two functions to calculate the product and the sum of two complex numbers. A third function should ask the user to input two complex numbers together with an operation, and then display the result.

Format

Files

You should submit a tar file containing a c source file ex1.c

Input

two complex numbers whose real and imaginary parts are integers and an operator on one line

Output

one complex number on one line

if the imaginary part of the result is 0, use "+0i"

Note

no space is allowed in a complex number; expected format is \(sa\pm bi\), where \(s\) is - or nothing and \(a\) and \(b\) are two numbers.

Sample 1

Input

1+2i 3-4i +

Output

4-2i

Limitation

1s, 32MiB for each test case.

Assignment 4

Not Claimed
Status
Finished
Problems
3
Open Since
2018-06-14 14:00
DDL
2018-06-21 14:00
Extension
240.0 hour(s)