코드 ¶
~cpp // 10195 - The Knights of the Round Table #include <iostream> using namespace std; #include <cstdio> #include <cmath> void process(const double a, const double b, const double c) { double area, s, r; s = (a + b + c) / 2; area = sqrt(s * (s - a) * (s - b) * (s - c)); r = ((a + b + c) != 0) ? (2 * area) / (a + b + c) : 0; printf("The radius of the round table is: %.3f\n", r); } int main() { double a, b, c; while (cin >> a >> b >> c) process(a, b, c); return 0; }