example5.c
来自「北大青鸟软件工程师ppt的学生用书源代码」· C语言 代码 · 共 21 行
C
21 行
#include<stdio.h>
struct complex
{
double re;//实部
double im;//虚部
};
struct complex add(struct complex,struct complex);
void main()
{
struct complex x={6.5,8.9},y={7.1,9.4};
struct complex z;
z=add(x,y);
printf("和为:%5.2lf+i%5.2lf\n",z.re,z.im);
}
struct complex add(struct complex a,struct complex b)
{
struct complex c;
c.re=a.re+b.re;
c.im=a.im+b.im;
return c;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?