1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-12-16 15:44:39 +00:00
202401-programming-assignments/【实践课内】15.结构体1/6-1 计算两个复数之积.c

7 lines
196 B
C
Raw Normal View History

2024-12-11 02:24:37 +00:00
struct complex multiply(struct complex x, struct complex y) {
struct complex z;
z.real = x.real * y.real - x.imag * y.imag;
z.imag = x.real * y.imag + x.imag * y.real;
return z;
}