1 条题解
-
0
#include <stdio.h> #include <math.h> double x1, y11, x2, y2, x3, y3, a, b, c, p; inline double dis(double x1, double y11, double x2, double y2) { return sqrt((x1 - x2) * (x1 - x2) + (y11 - y2) * (y11 - y2)); } int main(void) { scanf("%lf %lf %lf %lf %lf %lf", &x1, &y11, &x2, &y2, &x3, &y3); a = dis(x1, y11, x2, y2); b = dis(x2, y2, x3, y3); c = dis(x3, y3, x1, y11); p = (a + b + c) / 2; printf("%.2lf\n", sqrt(p * (p - a) * (p - b) * (p - c))); return 0; }
- 1
信息
- ID
- 38
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 8
- 标签
- 递交数
- 194
- 已通过
- 37
- 上传者