杭电acm1071

#include 
#include 
using namespace std;
int main()
{   int t;
    double x1,y1,x2,y2,x3,y3,a,k,s;
    cin>>t;
    while(t--)
    { cin>>x1>>y1>>x2>>y2>>x3>>y3;
      a=(y2-y1)/((x2-x1)*(x2-x1));
      k=(y2-y3)/(x2-x3);
      s=a/3*(x3*x3*x3-x2*x2*x2)+(a*x1*x1+k*x3+y1-y3)*(x3-x2)+0.5*(2*a*x1+k)*(x2*x2-x3*x3);
       printf("%.2f\n",s);
    }
return 0;
}

转载于:https://www.cnblogs.com/StevenL/p/6818546.html

你可能感兴趣的:(杭电acm1071)