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