编程介的小学生 2019-06-11 16:37 采纳率: 20.5%
浏览 103

该如何计算大楼的高度的问题,怎么用C语言的程序编写的代码设计的形式去回答的呢?

Problem Description
One day, zp, wangchaohui and snowingsea passed by Science Building on the way to have dinner, after their working on puzzle.

zp asks:”Do you know how high the building is?”, but none of them knew. "So let’s measure it!", snowingsea shouted out. Then they borrowed n theodolites(a tool used to measure angle of elevation). The n theodolites were placed on the ground around the building, which formed an n-edge regular polygon. The building was inside the regular polygon. Each edge of the polygon is s meters, and the height of theodolite was h centimeters. They wrote down the angle of elevation in degrees from each theodolite to the top of the building. They wanted to calculate the building's height according to the data they measured. Can U help them.

Input
The input consists of several test cases. The first line contains an integer T representing the number of test cases. Each test case contains two lines. The first line contains three integers, they are n, s, h, ( described in problem's description ). The second line contains n float numbers, which are the angles of each elevation they wrote down. 3 ≤ n ≤ 100, 0 < s, h < 10 000.

Output
For each case, print the height of the science building in meters in a separate line. The answer should be rounded to four decimal digits.

Sample Input
1
3 100 100
60 60 60

Sample Output
101.0000

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 对于相关问题的求解与代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料