UVa Problem 10195 The Knights of the Round Table (圆桌骑士)
2011-11-10 01:00
337 查看
// The Knights of the Round Table (圆桌骑士) // PC/UVa IDs: 111303/10195, Popularity: A, Success rate: average Level: 2 // Verdict: Accepted // Submission Date: 2011-11-01 // UVa Run Time: 0.016s // // 版权所有(C)2011,邱秋。metaphysis # yeah dot net // // [解题方法] // 问题的实质是求三角形内接圆的半径,由余弦定理加上简单的运算即可求得,注意处理某边边长为 0 的特 // 殊情况。 #include <iostream> #include <iomanip> #include <cmath> using namespace std; int main(int ac, char *av[]) { double a, b, c, r; cout.precision(3); cout.setf(ios::fixed | ios::showpoint); while (cin >> a >> b >> c) { if (a == 0.0 || b == 0.0 || c == 0.0) r = 0.0; else { double A, C; A = acos((b * b + c * c - a * a) / (2.0 * b * c)); C = acos((a * a + b * b - c * c) / (2.0 * a * b)); r = b * tan(A / 2) * tan(C / 2) / (tan(A / 2) + tan(C / 2)); } cout << "The radius of the round table is: " << r << endl; } return 0; }
相关文章推荐
- uvalive 3523 Knights of the Round Table 圆桌骑士(强连通+二分图)
- UVa 10195 - The Knights Of The Round Table
- UVA 10195 - The Knights Of The Round Table
- UVALive 3523 Knights of the Round Table 圆桌骑士 (无向图点双连通分量)
- UVAlive3523 Knights of the Round Table(bcc)
- UVALive3523 [Knights of the Round Table] tarjan求无向图双联通分量
- poj2942--F - Knights of the Round Table(圆桌骑士,经典连通分量)
- UVALive - 3523 Knights of the Round Table(无向图的双连通分量)
- UVA 1364 - Knights of the Round Table (找双连通分量 + 二分图染色法判断)
- UVALive3523-Knights of the Round Table(BCC+二分图判定)
- UVAlive 3523 Knights of the Round Table [点双连通分量] [Tarjan]
- UVALive - 3523 Knights of the Round Table(【点双连通分量】+【二分图判定】)
- uva 1364 - Knights of the Round Table(二分图+强连通)
- UVAlive3523 Knights of the Round Table(bcc)
- uva1364 - Knights of the Round Table 点-双联通分量
- UVA 1364 Knights of the Round Table(双联通+二分图)
- UVA 1364 - Knights of the Round Table(双连通+二分图判定)
- UVA 1364 - Knights of the Round Table (获得双连接组件 + 二部图推理染色)
- UVALive 3523 Knights of the Round Table(二分图+双连通分量)
- UVALive-3523 Knights of the Round Table (双连通分量+二分图匹配)