/* Question address: http://acm.hdu.edu.cn/showproblem.php? PID = 1071 click to open the link question: Using points for area experience: some library functions can not be renamed with them, the name is also very important, X1, y1 and map cannot be arbitrarily named */# include <iostream> # include <cstring> # include <cstdio> # include <cmath> // I didn't expect that x1 exists in cmath., y1. you cannot directly compile using namespace STD; Double A, A1, B1; double X11, y11, x22, y22, x33, y33; double cal1 (Double X) // calculate the parabolic function value {return a * (x-x11) * (x-x11) + y11;} double cal2 (Double X) // calculate the function value of the straight line {return A1 * x + b1;} int main () {int t; CIN> T; while (t --) {scanf ("% lf", & X11, & y11, & x22, & y22, & x33, & y33 ); if (x22> x33) {Double P = x22; x22 = x33; x33 = P; P = y22; y22 = y33; y33 = P;} A = (y22-y11) /(x22-x11) * (x22-x11); a1 = (y22-y33)/(x22-x33); b1 = (x33 * y22-x22 * y33)/(x33-x22); double S = 0; double I; for (I = x22; I <= x33; I + = 0.00005) // obtain the area S + = (FABS (cal1 (I) -cal2 (I) * 0.00005; printf ("%. 2f \ n ", S);} return 0 ;}