UVa 10195 - The Knights Of The Round Table
来源:互联网 发布:生活品质 知乎 编辑:程序博客网 时间:2024/04/28 17:47
题目:圆桌骑士0 0?给出三角形三边长度,求内切圆半径。
分析:简单题、计算几何。利用三角形面积联立等式。S = (a+b+c)*r = 0.5*sqrt(p*(p-a)*(p-b)*(p-c))(海伦公式、p=0.5*(a+b+c))。
注意:l1+l2+l3可能为0。
#include <stdio.h>#include <stdlib.h>#include <math.h>int main(){double l1,l2,l3;while ( scanf("%lf%lf%lf",&l1,&l2,&l3) != EOF ) {double p = (l1+l2+l3)*0.5;double s = sqrt(p*(p-l1)*(p-l2)*(p-l3));double r = (l1+l2+l3)?2.0*s/(l1+l2+l3):0.0;printf("The radius of the round table is: %.3lf\n",r);}return 0;}
- [uva] 10195 - The Knights Of The Round Table
- UVA 10195 - The Knights Of The Round Table
- UVa 10195 - The Knights Of The Round Table
- UVA-Knights of the Round Table La3523
- Knights of the Round Table
- Knights of the Round Table
- Knights of the Round Table
- UVa Problem 10195 The Knights of the Round Table (圆桌骑士)
- The Knights of the Round Table
- POJ 2942 Knights of the Round Table
- poj 2942 Knights of the Round Table
- POJ 2942 Knights of the Round Table
- POJ 2492 Knights of the Round Table
- UVA1364 Knights of the Round Table
- POJ2942--Knights of the Round Table
- POJ 2942: Knights of the Round Table
- LA 3523 - Knights of the Round Table
- poj 2942 Knights of the Round Table
- 数据结构:块状链表
- Little happiness matters?蒙牛新广告语英文翻译引争议
- Google Protobuf——实现跨平台跨语言的序列化/反序列化
- 观点:讨论来讨论去,还是讨论用哪个框架。。。
- Visual Leak Detector - 增强内存泄漏检测工具 for Visual C++ (翻译)(转载)
- UVa 10195 - The Knights Of The Round Table
- 插入排序法-c#
- oracle专门用来null值排序
- ORA-39083,ORA-02298错误一则
- Oracle数据库中NOLOGGING和FORCE LOGGING的理解
- mtk make:*** [xml_parser] Error 255
- iPad、iPhone 界面设计标准
- RVDS2.2 破解版成功安装与AXD调试步骤
- Illiquid asset