C语言写程序 +20分 12

来源:百度知道 编辑:UC知道 时间:2024/05/23 18:17:28
求三角形的面积.

#include<stdio.h>
#include <math.h>

void main()
{

float a,b,c;
float s,t,p;
printf("请输入三边:\n");
scanf("%f",&a);
scanf("%f",&b);
scanf("%f",&c);
p =(a+b+c)/2;
t = p*(p-a)*(p-b)*(p-c);
s = sqrt(t);
printf("%f",s);

}

挖坑!站座!
#include<stdio.h>
#include <math.h>
main()
{ float a,b,c,p,t,s;
printf("please input:\n");
scanf("%f%f%f",&a,&b,&c);
p =(a+b+c)/2;
t = p*(p-a)*(p-b)*(p-c);
s = sqrt(t);
printf("%f",s);
}
C语言中无法输入中文注意!

晕.好象在C语言书上有吧.我忘记可 呵呵

在那个C语言设计书上有.好象在5部分.



把每个边长作为已知函数输入,再用那个什么公式(cosXX的),一个主函数就写出来了
很简单的啊

这样不是更简单明了吗。
#include<stdio.h>
#include <math.h>
void main()
{ float a,b,c,p,t,s;
printf("请输入三边:\n&qu