设计一个复数类.从键盘输入2个复数,完成复数的加减运算,然后输出运算结果.

问题描述:

设计一个复数类.从键盘输入2个复数,完成复数的加减运算,然后输出运算结果.
struct complex
{
\x05double real;
\x05double imaginary;
};
struct complex input(void)
{
}
struct complex plus(struct complex a,struct complex b)
{
}
struct complex minus(struct complex a,struct complex b)
{
}
void output(struct complex a)
{
}
int main()
{
}

#include struct complex{double real;double imaginary;};struct complex input(void){struct complex num;printf("input complex number (eg.2.0+1.1i):");scanf("%lf+%lfi",&num.real,&num.imaginary);return num...