题解 | #计算三角形的周长和面积#
计算三角形的周长和面积
https://www.nowcoder.com/practice/109a44d649a142d483314e8a57e2c710
#include <stdio.h> #include <math.h> int main() { float a = 0; float b = 0; float c = 0; scanf("%f %f %f",&a,&b,&c); float cir = 0; float area = 0; cir = a + b + c; float i = cir/2; area = sqrt((i)*(i - a)*(i - b)*(i - c)); printf("circumference=%.2f area=%.2f",cir,area); return 0; }