1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-23 15:48:42 +00:00
202401-programming-assignments/【额外练习】选择结构/7-36 选择-三角形和圆.c

27 lines
441 B
C

#include <math.h>
#include <stdio.h>
int main() {
double a, b, c, r;
scanf("%lf%lf%lf%lf", &a, &b, &c, &r);
double s = (a + b + c) / 2.0;
if (s <= a || s <= b || s <= c) {
printf("No\n");
return 0;
}
double area = sqrt(s * (s - a) * (s - b) * (s - c));
double inRadius = area / s;
if (r <= inRadius) {
printf("Yes\n");
} else {
printf("No\n");
}
return 0;
}