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