标题:求助啊,这个程序哪里有问题啊。总提示没有complex,film
取消只看楼主
王凯的编译
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2016-7-18
结帖率:0
已结贴  问题点数:10 回复次数:0 
求助啊,这个程序哪里有问题啊。总提示没有complex,film
/* Program 2.17 Working with complex numbers*/

#include <stdio.h>
#include <complex.h>


int main(void)
{
    double complex cx=1.0+3.0*I;
    double complex cy=1.0-4.0*I;

    printf("Working with complex numbers:");
    printf("\nStarting values: cx=%.2f%+.2fi cy=%.2f%+.2fi",
              creal(cx),cimag(cx),creal(cy),cimag(cy));

    double complex sum=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(quoient),cimag(quotient));

    double complex conjugate=conj(cx);
    printf("\n\n The conjugate of cx =%.2f%+.2fi",
                 creal(conjugate),cimag(conjugate));
    return 0;
}
搜索更多相关主题的帖子: difference complex include numbers double 
2016-07-18 17:55



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-467027-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.240663 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved