c语言,刚学

来源:百度知道 编辑:UC知道 时间:2024/05/16 03:05:20
#include<stdio.h>
main(){ int a,b,c; float e,f;scanf(" %d,%d,%d",&a,&b,&c);
e=(float)(a+b+c)/2; f=sqrt(e*(e-a)*(e-b)*(e-c));printf("f=%2lf",f)}
整段就是这样,我输入了3 4 5
结果输出了33.00,为什么,哪错了

#include<stdio.h>
#include <math.h>
main()
{
int a,b,c;
float e,f;
scanf(" %d,%d,%d",&a,&b,&c);
e=(float)(a+b+c)/2.0;
f=sqrt(e*(e-a)*(e-b)*(e-c));
printf("f=%2.1f",f);
}
你没有加#include <math.h>
还有不能输入3 4 5,应该是3,4,5