标题:c(15) : error C2059: syntax error : 'type'
只看楼主
星磊99
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2018-4-21
结帖率:50%
已结贴  问题点数:20 回复次数:2 
c(15) : error C2059: syntax error : 'type'
#include <stdio.h>
#include <math.h>

int main(void)
{
    double n, a, b;
    a = sqrt(n+100);
    b = sqrt(n+168);
    if (a-int(a)==0 && b-int(b)==0)
        printf("%f", n);

    return 0;

}
c(15) : error C2059: syntax error : 'type'  这是为什么
搜索更多相关主题的帖子: C2059 syntax type include sqrt 
2018-04-21 14:21
李晨经纪人
Rank: 8Rank: 8
等 级:蝙蝠侠
威 望:6
帖 子:175
专家分:848
注 册:2018-2-14
得分:20 
你的n没有初始化
 if (a-int(a)==0 && b-int(b)==0)
改成
 if (a-(int)a==0 && b-(int)b==0)
2018-04-21 14:41
星磊99
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2018-4-21
得分:0 
回复 2楼 李晨经纪人
谢谢
2018-04-22 16:17



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




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

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