1// 计算三角形面积.cpp : 定义控制台应用程序的入口点。
#include "stdafx.h"
#include "math.h"
float area1(float a,float b,float c)//用海伦公式计算三角形面积
{
float s1;
float p;
p = (a+b+c)/2;
s1 = sqrt(p*(p-a)*(p-b)*(p-c));
return s1;
}
float area2(float x,float y)//用简便方法计算三角形面积
{
float s2;
s2 = x*y/2;
return s2;
}
void main()
{
float a;
float b;
float c;
float s1;
float s2;
float x;
float y;
printf("pleace input the first line length: ");//分别输入三边的长度版权文档,请勿用做商业用途
scanf("%f",&a);
printf("pleace input the second line length: ");
scanf("%f",&b);
printf("pleace input the third line length: ");
scanf(&#