题目:http://acm.hdu.edu.cn/showproblem.php?pid=1071
同样是高数知识;感觉这章几乎都是数学知识,悲剧的数学。。不会啊。。。
看的题解
#include<stdio.h>
#include<math.h>
double x,y,x2,y2,x3,y3,area;
double l,h,a,k,b;
double f(double x)
{return (a*x*x*x/3)-(a*h+k/2)*x*x+(a*h*h+l-b)*x;}
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
scanf("%lf%lf%lf%lf%lf%lf",&x,&y,&x2,&y2,&x3,&y3);
h=x;l=y;a=(y2-y)/((x2-x)*(x2-x));
k=(y3-y2)/(x3-x2);b=y2-k*x2;
printf("%.2lf\n",f(x3)-f(x2));
}
return 0;
}