| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 7317 人关注过本帖
标题:error C2064: term does not evaluate to a function 如何解决
只看楼主 加入收藏
pming1
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2011-10-19
结帖率:0
收藏
已结贴  问题点数:20 回复次数:3 
error C2064: term does not evaluate to a function 如何解决
#include "stdafx.h"
#include "math.h"
int main(int argc, char* argv[])
{
    printf("Hello World!\n");
    printf("Please input 3 integers to work out the area of triangle");
    int a,b,c;
    double s,area;
    scanf("%d %d %d",&a,&b,&c);
    printf("You input the 3 integers are%d--%d--%d",a,b,c);
    if ((a+b)>c&&(a-b)<c)
    {
        s=0.5*(a+b+c);
        area=sqrt(s*(s-a)(s-b)(s-c));
        printf("The Triangle's area is%d");
    }
    else
        printf("The integers you inputed are wrong which can not be a triangle");
    return 0;
}




系统显示:error C2064: term does not evaluate to a function
我是初学者,请问如何解决这个问题,谢谢!
搜索更多相关主题的帖子: 如何 function triangle include 
2011-10-19 22:31
laznrbfe
Rank: 10Rank: 10Rank: 10
等 级:青峰侠
帖 子:482
专家分:1599
注 册:2011-5-22
收藏
得分:10 
程序代码:
if ((a+b)>c&&(a-b)<c)
    {
        s=0.5*(a+b+c);
        area=sqrt(s*(s-a)*(s-b)*(s-c));/////乘号不能省略!!!
        printf("The Triangle's area is %f\n",area);/////%d换成%f并且加上,area
    }
有问题的语句我注释出来了~
2011-10-19 22:52
embed_xuel
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
等 级:贵宾
威 望:58
帖 子:3845
专家分:11385
注 册:2011-9-13
收藏
得分:10 
回复 楼主 pming1
scanf("%lf %lf %lf",&a,&b,&c);
area=sqrt(s*(s-a)*(s-b)*(s-c));        printf("The Triangle's area is %f", area);
手机党,没运行过,你自己验一下吧

[ 本帖最后由 embed_xuel 于 2011-10-19 22:54 编辑 ]

总有那身价贱的人给作业贴回复完整的代码
2011-10-19 22:52
pming1
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2011-10-19
收藏
得分:0 
谢谢!太不注意细节了!
2011-10-19 22:58
快速回复:error C2064: term does not evaluate to a function 如何解决
数据加载中...
 
   



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

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