简单几何(推公式) UVA 11646 Athletics Track

 

题目传送门

题意:给了长宽比例,操场一圈400米,问原来长宽的长度

分析:推出公式

 

/************************************************
* Author        :Running_Time
* Created Time  :2015/10/22 星期四 15:19:59
* File Name     :UVA_11646.cpp
 ************************************************/

#include <cstdio>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <list>
#include <map>
#include <set>
#include <bitset>
#include <cstdlib>
#include <ctime>
using namespace std;

#define lson l, mid, rt << 1
#define rson mid + 1, r, rt << 1 | 1
typedef long long ll;
const int N = 1e5 + 10;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const double EPS = 1e-10;

int main(void)    {
    int l, w, cas = 0;
    while (scanf ("%d : %d", &l, &w) == 2)  {
        double a = w * 1.0 / l;
        double rad = atan (a);
        double L = 200.0 / (1 + rad * a / sin (rad));
        double W = a * L;
        printf ("Case %d: %.10f %.10f\n", ++cas, L, W);
    }

    return 0;
}

  

转载于:https://www.cnblogs.com/Running-Time/p/4901292.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值