You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
389 B
17 lines
389 B
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
|
|
int main() {
|
|
double a, b, c, p;
|
|
cin >> a >> b >> c;
|
|
//scanf("%d %d %d", &a, &b, &c);
|
|
|
|
if (a + b <= c || a + c <= b || b + c <= a) {
|
|
printf("输入的边长不合法!");
|
|
return 0;
|
|
}
|
|
p = 1.0 / 2 * (a + b + c);
|
|
printf("%.1lf", sqrt(p * (p - a) * (p - b) * (p - c)));
|
|
return 0;
|
|
} |