图普科技2018届秋招在线笔试 register

Ended

Participants:463

Verdict:Wrong Answer
Score:10 / 100
Submitted:2017-10-15 12:46:13

Lang:GCC

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <stdio.h>
typedef struct {
    double x,y;
} coord_t;
coord_t coord_sub(coord_t a, coord_t b) {
    return (coord_t) { a.x - b.x, a.y - b.y };
}
double coord_dot(coord_t a, coord_t b) { return a.x * b.y - b.x * a.y; }
double dabs(double x) { return x < 0 ? -x : x; }
double max(double a, double b, double c) {
    if (a > b) return a > c ? a : c;
    else return b > c ? b : c;
}
int main() {
    coord_t P, A, B, C;
    coord_t pa, pb, pc;
    double pab, pbc, pca;
    double abc, sum, area;
    while (scanf("%lf%lf %lf%lf %lf%lf %lf%lf", 
                &P.x, &P.y, 
                &A.x, &A.y, 
                &B.x, &B.y, 
                &C.x, &C.y) != EOF) {
        abc = dabs(coord_dot(coord_sub(C,A), coord_sub(B,A)));
        pa = coord_sub(A, P);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX