面积求解:1、s=(a+b+c)/2
2、area=sqrt(s*(s-a)*(s-b)*(s-c))
边长求解:l=a+b+c
#include<stdio.h>
#include<math.h>
int main(){
float a,b,c,s,are,L;
printf("Enter 3 sides of the triangle:");
scanf("%f%f%f",&a,&b,&c);
if(a+b<=c||b+c<=a||a+c<=b){
printf("These sides do not correspond to avalid triangle");
}
else{
s=(a+b+c)/2;
are=sqrt(s*(s-a)*(s-b)*(s-c));
L=a+b+c;
printf("area=%.2f;perimeter=%.2f",are,L);
}
return 0;
}