题解 | #计算三角形的周长和面积#
计算三角形的周长和面积
https://www.nowcoder.com/practice/109a44d649a142d483314e8a57e2c710
#include <stdio.h> #include<math.h> int main() { int a, b, c = 0; scanf("%d %d %d", &a, &b, &c); double circumference = a + b + c; float d = circumference / 2.0; float area = sqrt(d * (d - a) * (d - b) * (d - c)); printf("circumference=%.2f area=%.2f", circumference,area); return 0; }
c语言刷题 文章被收录于专栏
c语言刷题题目