面积area的算法:area=√s(s-a)(s-b)(s-c)×s=(a+b+c)/2
收起
#include <stdio.h> #include <math.h> float S(float a, float b, float c) { float s = (a + b + c) / 2; return sqrt(s * (s - a) * (s - b) * (s - c)); } void main() { printf("%.2f", S(3, 4, 5)); }
报告相同问题?