数学题,先求抛物线和直线的系数,再利用积分公式求面积。
#include <stdio.h>
#include <math.h> int main() {
double x1, x2, x3, y1, y2, y3;
double a, b, c, k, m;
double s1, s2;
int case_n; scanf("%d", &case_n); while (case_n--) {
scanf("%lf%lf%lf%lf%lf%lf", &x1,&y1, &x2,&y2, &x3,&y3);
a = (y2-y1) / pow(x2-x1, );
b = -*a*x1;
c = a*x1*x1+y1;
k = (y2-y3) / (x2-x3);
m = y3 - k*x3;
s1 = a*pow(x2, )/ + (b-k)*x2*x2/ + (c-m)*x2;
s2 = a*pow(x3, )/ + (b-k)*x3*x3/ + (c-m)*x3;
printf("%.2lf\n", s2-s1);
} return ;
}