
为什么我将下面的程序放在VS2010 里不能运行 本人还是一个c语言菜鸟 ,望说的详细点
#include"stdafx.h"#include<complex.h>intmain(void){double_complexcx=1.0+3.0*I;double_...
#include "stdafx.h"
#include <complex.h>
int main(void)
{
double _complex cx = 1.0+3.0*I;
double _complex cy = 1.0-4.0*I;
printf("woking with complex number:");
printf("\nstarting values :cx=%.2f+.2fi cy =%.2f+.2fi",creal(cx),cimag(cx),creal(cy),cimag(cy));
double _complex=cx+cy;
printf("\n\nthe sum cx+cy=%.2f+.2fi",creal(sum),cimag(sum));
double _complex difference= cx-cy;
printf("\n\nthe difference cx-cy=%.2f+.2fi",creal(difference),cimag(difference));
double _complex product=cx*cy;
printf("\n\nthe product cx*cy=%.2f+.2fi",creal(product),cimag(product));
double _complex quotient=cx/cy;
printf("\n\nthe quotient cx/cy=%.2f+.2fi",creal(quotient),cimag(quotient));
double _complex conjugate=conj(cx);
printf("\n\nthe conjugate of cx=%.2f+.2fi",creal(conjugate),cimag(conjugate));
return 0;
} 展开
#include <complex.h>
int main(void)
{
double _complex cx = 1.0+3.0*I;
double _complex cy = 1.0-4.0*I;
printf("woking with complex number:");
printf("\nstarting values :cx=%.2f+.2fi cy =%.2f+.2fi",creal(cx),cimag(cx),creal(cy),cimag(cy));
double _complex=cx+cy;
printf("\n\nthe sum cx+cy=%.2f+.2fi",creal(sum),cimag(sum));
double _complex difference= cx-cy;
printf("\n\nthe difference cx-cy=%.2f+.2fi",creal(difference),cimag(difference));
double _complex product=cx*cy;
printf("\n\nthe product cx*cy=%.2f+.2fi",creal(product),cimag(product));
double _complex quotient=cx/cy;
printf("\n\nthe quotient cx/cy=%.2f+.2fi",creal(quotient),cimag(quotient));
double _complex conjugate=conj(cx);
printf("\n\nthe conjugate of cx=%.2f+.2fi",creal(conjugate),cimag(conjugate));
return 0;
} 展开
1个回答
2016-01-14
展开全部
无法回答。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询