#include <stdio.h>
#include <math.h>
int main(int argc, char const *argv[])
{
float a;
float b;
float c;
float perimeter;
float area;
float half_perimeter;
printf("请输入三边: \n");
scanf("%f%f%f",&a,&b,&c);
perimeter = a + b + c ;
half_perimeter = perimeter / 2;
area = sqrt(half_perimeter * (half_perimeter - a) * (half_perimeter - b) * (half_perimeter - c));
printf("三角形的周长为: %f,面积为:%f\n",perimeter,area);
return 0;
}
温馨提示:答案为网友推荐,仅供参考