此程序求两复数减法运算,帮看一下为何出错?
#include "stdio.h"typedef.struct
{
float read,imag;
}complex;
complex sub(complex fs1,complex fs2)
{
complex fs3;
fs3.read=fs1.read-fs2.read;
fs3.imag=fs1.imag-fs2.imag;
return fs3;
}
main()
{
complex fs1,,fs2,fs3;
float a,b,c,d;
printf("输入复数FS1实虚部:、\n");
scanf("%f%f",&a,&b);
fs1.read=a;
fs1.imag=b;
printf("输入复数FS2实虚部:\n");
scanf("%f%f',&c,&d);
fs2.read=c;
fs2.imag=d;
printf("所输入的两复数分别为:\n");
printf("fs1=%f+%fi",fs1.read,fs2.imag);
printf("fs2=%f+%fi",fs2.read,fs2.imag);
fs3=sub(fs1,fs2);
printf("fs3=fs1-fs2=%f+%fi",fs3.read,fs3.imag);
}