计算两个复数之积

https://pintia.cn/problem-sets/12/problems/348

1 struct complex multiply(struct complex x, struct complex y)
2 {
3     struct complex ret;
4 
5     ret.real = x.real * y.real - x.imag * y.imag;
6     ret.imag = x.real * y.imag + x.imag * y.real;
7 
8     return ret;
9 }
posted @ 2020-01-17 12:17  jason2018  阅读(887)  评论(0编辑  收藏  举报