sdnu oj 1282 愤怒的小鸟

如果还在上高中,大概不会被卡住2333

在这里插入图片描述

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <math.h>

using namespace std;

int main()
{
    int T;
    int p, t, n;
    double x, ty, a, b, s1, s2;
    scanf("%d", &T);
    while(T--)
    {
        scanf("%d%d%lf", &p, &t, &x);
        b = tan(x);
        double tmp = (double)(2.0*t*p - t*t);
        a = (-b*p)/tmp;
        s1 = a*t*t*t/3 + b*t*t/2;
        ty = a*t*t + b*t;
        s2 = ty*(p-t)*0.5;
        printf("%.3lf\n", s1+s2);
    }
}

发布了40 篇原创文章 · 获赞 4 · 访问量 1133

猜你喜欢

转载自blog.csdn.net/xiongshuxian2019/article/details/104417886