Lang:GCC
Edit12345678910111213141516171819202122232425262728293031#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);