double x1, x2, x3, y1, y2, y3;scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3)double a =sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));double b =sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));double c =sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2));double p =(a+b+c)/2;double s = s=sqrt(p*(p-a)*(p-b)*(p-c));printf("%.3lf\n", s);
double x1, x2, x3, y1, y2, y3;scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3)double A =sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3));double B =sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));double C =sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));double S = A+B+C;double x =(A*x1+B*x2+C*x3)/S;double y =(A*y1+B*y2+C*y3)/S;printf("%.3lf %.3lf\n", x, y);
重心(中线交点)
double x1, x2, x3, y1, y2, y3;scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3)double x =(x1+x2+x3)/3;double y =(y1+y2+y3)/3;printf("%.3lf %.3lf\n", x, y);