#include
#include
main()
{
double s,l,a,b,c,p;
printf("请输入三边长:");
scanf("%d%d%d",&a,&b,&c);
p=(a+b+c)/2;
if(a+b>c&&b+c>a&&a+c>b)
{
l=a+b+c;
s=sqrt(p*(p-a)*(p-b)*(p-c));
printf("周长是%d,面积是%d\n",l,s);
}
else printf("这不能组成三角形\n");
}
求三角形周长面积
Posted on 2019-12-17 0 Views
Comments | NOTHING