请个高手帮我看看我写的”求两个复数的和”的程序哪儿错了!谢谢帮我指点一下!
#include<stdio.h>
struct complex
{
int real;
int im;
};
struct complex cadd(struct complex creal,struct complex cim)
{
struct complex a;
a.real=creal.real+cim.real;
a.im=creal.im+cim.im;
return a;
}
main()
{
struct complex creal;
struct complex cim;
struct complex a;
printf(“input creal.real,creal.im,cim.real,cim.im”);
scanf(“%d%d%d%d”,&creal.real,&creal.im,&cim.real,&cim.im);
printf(“%d%d”,a.real,a.im);
}
>> 本文固定链接: http://www.vcgood.com/archives/1861
函数没调用!
[code]
a = cadd( creal, cim );
printf("%d %d",a.real,a.im);
[/code]