16.2练习题
(a)
struct complex
{
double real, imaginary;
};
或者
trpedef struct
{
double real, imaginary;
}complex;
(b)
struct complex
{
double real, imaginary;
};
complex c1,c2,c3;
(c)
struct complex
{
double real,imaginary;
};
complex make_complex(double a, double b)
{
struct complex p;
return p;
};
(d)
struct complex
{
double real,imaginary;
}a,b;
complex add_complex(struct complex a, struct complex b)
{
struct complex p;
p.real = a.real+b.real;
p.imaginary = a.imaginary+b.imaginary;
return p;
};