Files
OOP-Cpp/oop_hw1/oop_hw1_4/t_area.cpp
2025-08-11 00:01:30 +08:00

5 lines
153 B
C++

#include <cmath>
double triangle_area(double a, double b, double c) {
double s = (a + b + c) / 2;
return sqrt(s * (s - a) * (s - b) * (s - c));
}