题解 | #计算三角形的周长和面积#
计算三角形的周长和面积
https://www.nowcoder.com/practice/109a44d649a142d483314e8a57e2c710
#include <stdio.h> #include <math.h> int main(void) { double a, b, c; double circumference, area; scanf("%lf %lf %lf", &a, &b, &c); circumference = a + b + c; //海伦公式 area = sqrt(circumference/2*(circumference/2 -a)*(circumference/2 - b)*(circumference/2 -c)); printf("circumference=%.2f area=%.2f\n", circumference, area); return 0; }
#猹的刷题生涯#