计算机C语言的习题输入三角形的3
#include
#include
int could(float a,float b,float c)
{
if(a+b>c&&a+c>b&&b+c>a)
return 1;
else
return 0;
}
float area(float a,float b,float c)
{
float s=(a+b+c)/2;
return sqrt(s*(s-a)*(s-b)*(s-c))
}
float perimeter(float a,float b,float c)
{
return a+b+c;
}
void main ()
{
float a,b,c;
cout>a>...全部
#include
#include
int could(float a,float b,float c)
{
if(a+b>c&&a+c>b&&b+c>a)
return 1;
else
return 0;
}
float area(float a,float b,float c)
{
float s=(a+b+c)/2;
return sqrt(s*(s-a)*(s-b)*(s-c))
}
float perimeter(float a,float b,float c)
{
return a+b+c;
}
void main ()
{
float a,b,c;
cout>a>>b>>c;
if(could(a,b,c))
{
cout<<'\n'<<"该三角形的面积是"< 我是大二的,刚刚参加完计算机二级考试。这道题我以前做过,是我临时编写的。应该不会有错误。收起