标签:blank img ima div closed 描述 esc ret numbers
题目链接:
http://acm.hdu.edu.cn/showproblem.php?pid=1071
1 #include<stdio.h> 2 int main() 3 { 4 int T; 5 double x1,x2,x3,y1,y2,y3,a,b,c,k,h,ans; 6 scanf("%d",&T); 7 while(T--) 8 { 9 scanf("%lf%lf",&x1,&y1); 10 scanf("%lf%lf",&x2,&y2); 11 scanf("%lf%lf",&x3,&y3); 12 k=(y3-y2)/(x3-x2); 13 h=y3-k*x3; 14 a=(y2-y1)/( (x2*x2-x1*x1)-2*x1*(x2-x1) ); 15 b=-2*a*x1; 16 c=y1-a*x1*x1-b*x1; 17 ans=(a*x3*x3*x3/3+(b-k)*x3*x3/2+(c-h)*x3)-(a*x2*x2*x2/3+(b-k)*x2*x2/2+(c-h)*x2); 18 printf("%.2lf\n",ans); 19 } 20 return 0; 21 }
标签:blank img ima div closed 描述 esc ret numbers
原文地址:http://www.cnblogs.com/wenzhixin/p/7391235.html