博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
The area 积分积分
阅读量:6596 次
发布时间:2019-06-24

本文共 1723 字,大约阅读时间需要 5 分钟。

The area
Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u
Submit 

Description

Ignatius bought a land last week, but he didn't know the area of the land because the land is enclosed by a parabola and a straight line. The picture below shows the area. Now given all the intersectant points shows in the picture, can you tell Ignatius the area of the land? 
Note: The point P1 in the picture is the vertex of the parabola. 
 

Input

The input contains several test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow. 
Each test case contains three intersectant points which shows in the picture, they are given in the order of P1, P2, P3. Each point is described by two floating-point numbers X and Y(0.0<=X,Y<=1000.0). 
 

Output

For each test case, you should output the area of the land, the result should be rounded to 2 decimal places. 
 

Sample Input

2
5.000000 5.000000
0.000000 0.000000
10.000000 0.000000
10.000000 10.000000
1.000000 1.000000
14.000000 8.222222
 

Sample Output

33.33
40.69
 
 
1 #include 
2 #include
3 #include
4 #include
5 using namespace std; 6 struct point 7 { 8 double x,y; 9 } p1,p2,p3;10 double a,b,c,a1,b1;11 double F(double x)12 {13 return fabs(a*(x-b)*(x-b)+c-a1*x-b1);14 }15 void init()16 {17 b = p1.x;18 c = p1.y;19 a = (p2.y - c) / (p2.x - b) / (p2.x - b);20 a1 = (p3.y - p2.y) / (p3.x - p2.x);21 b1 = p2.y - a1 * p2.x;22 //cout<
<<" "<<<" "<
<<" "<
<<" "<
<<" "<
View Code

 

 
 

转载于:https://www.cnblogs.com/ERKE/p/3889116.html

你可能感兴趣的文章
Windows Server入门系列37 创建网络共享
查看>>
自己diy封装xp操作系统
查看>>
veritas升级及备份至磁盘两个问题简要说明
查看>>
Scoket:UDP通讯模型
查看>>
扯点关于经济的淡-贸易顺差都是有利的吗
查看>>
国产IT厂商激辩微软 微软反垄断调查或有突破
查看>>
《进化——我们在互联网上奋斗的故事》一一1.4 从精兵到强将 ——技术人员的职场发展之路...
查看>>
通过 LLVM 在 Android 上运行 Swift 代码
查看>>
《C程序员从校园到职场》一第2章 学校到职场2.1 认清自身不足
查看>>
jquery遍历的json有两层list时的解决方法
查看>>
Sql语句-case when then else end
查看>>
Python_编程特色
查看>>
ant打jar包
查看>>
【Android】The application has stopped unexpectedly.Please try again.
查看>>
为什么要使用Ajax
查看>>
java web开发使用伪静态
查看>>
CISCO交换机密码恢复
查看>>
我的友情链接
查看>>
有关在linux 下跑asp.net文章博客
查看>>
Linux/Unix的精巧约定两例及其简析:目录权限和文本行数
查看>>