uva375 Inscribed Circles and Isosceles Triangles

简介: uva375 Inscribed Circles and Isosceles Triangles
#include <stdio.h>#include <math.h>#define LOCAL#define PI asin(1.0) * 2intmain()
{
inttests;
doubleB, h, H;
doubler, R;
doubleedge;
inti;
#ifdef LOCALfreopen("c://uva_in.txt", "r", stdin);
#endifscanf("%d", &tests);
for (i=0; i<tests; i++)
    {
scanf("%lf%lf", &B, &H);
edge=sqrt(B*B/4+H*H);
R=B*H/ (2*edge+B);
h=H;
r=R;
while (r>=0.000001)
        {
h-=2*r;
r=h*R/H;
        }
printf("%13lf/n", (H-h) *PI);
if (i<tests-1)
        {
printf("/n");
        }
    }
return0;
}
目录
相关文章
uva 10340 all in all
输入两个字符串s和t,判断是否可以从t中删除0个或多个字符(其他字符顺序不变),得到字符串是。
49 0
uva10152 ShellSort
uva10152 ShellSort
74 0
UVa 10082 WERTYU
UVa 10082 WERTYU
136 0
UVa 10082 WERTYU
Problem Description A common typing error is to place the hands on the keyboard one row to the right of the correct position.
895 0
概率dp - UVA 11021 Tribles
Tribles  Problem's Link:  http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=33059   Mean:  有k个细菌,每个细菌只能存活一天,在死去之前可能会分裂出0,1,2....n-1个细菌,对应的概率为p0,p1,p2....pn-1。
839 0
|
机器学习/深度学习
|
机器学习/深度学习
uva 12470 Tribonacci
点击打开uva12470  思路: 矩阵快速幂 分析: 1 裸题 代码: /************************************************ * By: chenguolin ...
998 0
uva 10730 - Antiarithmetic?
点击打开链接uva 10730 思路:枚举等差中项 分析: 1 给定一个n个数的序列判断是否有等差子序列 2 很明显我们如果要判断是否有等差子序列的话,只要去判断是否有长度为3的等差子序列 3 对于n
851 0