UVa 10545 Maximal Quadrilateral:有内切圆的四边形面积

http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1486

公式参考维基百科  但还是觉得哪里不对(待研究,坑)

完整代码:

01./*0.018s*/
02.
03.#include<cstdio>
04.#include<cmath>
05.
06.int main()
07.{
08.    int t, cas = 0, p, a, b;
09.    double c, d;
10.    scanf("%d", &t);
11.    while (t--)
12.    {
13.        scanf("%d%d%d", &p, &a, &b);
14.        printf("Case %d: ", ++cas);
15.        if (2 * a > p || 2 * b >= p || a == 0 || b == 0)
16.        {
17.            puts("Eta Shombhob Na.");
18.            continue;
19.        }
20.        double c = (double)p / 2 - a;
21.        double d = (double)p / 2 - b;
22.        printf("%.6f\n", sqrt(a * b * c * d) * 2 / (a + b + c + d));
23.    }
24.}

查看本栏目更多精彩内容:http://www.bianceng.cnhttp://www.bianceng.cn/Programming/sjjg/

以上是小编为您精心准备的的内容,在的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索scanf
, http
, printf
, include
, double
eta rader 4
10545 2 1995、jb t 10545 2016、10545 99 0、maximal rectangle、maximal maximum,以便于您获取更多的相关知识。

时间: 2024-09-19 08:51:29

UVa 10545 Maximal Quadrilateral:有内切圆的四边形面积的相关文章

四边形面积探索

托勒密定理   ac+bd=mn   1.对角互补的四边形为什么一定有外接圆? 2.已知:四边形ABCD中,∠A+∠C=180°  求证:四边形ABCD内接于一个圆(A,B,C,D四点共圆) 证明:用反证法 过A,B,D作圆O,假设C不在圆O上,刚C在圆外或圆内, 若C在圆外,设BC交圆O于C',连结DC',根据圆内接四边形的性质得∠A+∠DC'B=180°, ∵∠A+∠C=180°∴∠DC'B=∠C 这与三角形外角定理矛盾,故C不可能在圆外.类似地可证C不可能在圆内. ∴C在圆O上,也即A,B

《从问题到程序:用Python学编程和计算》——2.12 练习

2.12 练习 概念和理解 复习下面概念:表达式,语句,赋值,控制结构,函数,提示符,值,求值,语法错误,单词,整数,浮点数,运算符,一元运算符,二元运算符,优先级,结合顺序,字面量,语法错误,续行,续行符,尾数,指数,精度,溢出,数值计算,误差,近似计算,对象,类型,整型,浮点型,类型名,数值类型,内置类型(标准类型),类型转换,强制类型转换,内置函数(标准函数),程序包,函数调用,实际参数(实参),返回值,程序包,导入,字符串,下标,下标越界,字符串长度,拼接,切片,变量,标识符,关键字,赋

Illustrator使用矩形工具绘制立方体教程一览

给各位Illustrator软件的使用者们来详细的解析分享一下使用矩形工具绘制立方体的教程. 教程分享: 1 用鼠标在"工具"功能板上单击,选择"矩形工具";用"矩形工具"在图形板上单击,出现"矩形"对话框,输入相同的"宽度"和"高度"值 , 使长方形的宽和高相等,即可绘制正方形.   2 用鼠标在"工具"功能板上单击或键入V,选择"选取工具";用

UVA之12124 - Assemble

[题目] Problem A - Assemble Time limit: 2 seconds Recently your team noticed that the computer you use to practice for programming contests is not good enough anymore. Therefore, you decide to buy a new computer. To make the ideal computer for your nee

UVa 10700:Camel trading

链接: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=113&page=show_problem&problem=1641 原题: Background Aroud 800 A.D., El Mamum, Calif of Baghdad was presented the formula 1+2*3*4+5, which had its origin in the

UVa 507:Jill Rides Again

题目链接: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=113&page=show_problem&problem=448 类型: 最大连续和 原题: Jill likes to ride her bicycle, but since the pretty city of Greenhills where she lives has grown, Jill oft

UVa 108:Maximum Sum

链接: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=113&page=show_problem&problem=44 原题: Background A problem that is simple to solve in one dimension is often much more difficult to solve in more than one dim

UVa 165:Stamps, 连续邮资问题

题目链接: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=108 类型: 回溯 原题: The government of Nova Mareterrania requires that various legal documents have stamps attached to them so that the government can derive revenue fro

NWERC 2007 / UVa 12124 Assemble:二分搜索&amp;amp;最小值最大问题

12124 - Assemble Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=456&page=show_problem&problem=3276 Recently your team noticed that the computer you use to practice for programming co