zoukankan      html  css  js  c++  java
  • HDU 5858 Hard problem

    Hard problem

    Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
    Total Submission(s): 192    Accepted Submission(s): 145


    Problem Description
    cjj is fun with math problem. One day he found a Olympic Mathematics problem for primary school students. It is too difficult for cjj. Can you solve it?


    Give you the side length of the square L, you need to calculate the shaded area in the picture.

    The full circle is the inscribed circle of the square, and the center of two quarter circle is the vertex of square, and its radius is the length of the square.
     
    Input
    The first line contains a integer T(1<=T<=10000), means the number of the test case. Each case contains one line with integer l(1<=l<=10000).
     
    Output
    For each test case, print one line, the shade area in the picture. The answer is round to two digit.
     
    Sample Input
    1 1
     
    Sample Output
    0.29
     
    Author
    BUPT
     
    Source
     
     
     
    解析:
     
     
     
    #include <cstdio>
    #include <cmath>
    
    int main()
    {
        int t;
        scanf("%d", &t);
        int l;
        while(t--){
            scanf("%d", &l);
            double res = 4*l*l*(1.0/8*asin(sqrt(7.0/8))-0.5*acos(5.0/8*sqrt(2))+sqrt(7)/16);
            printf("%.2f
    ", res);
        }
        return 0;
    }
    

      

      

  • 相关阅读:
    3年度研发项目情况项目目标文档
    2系统利益相关者描述案例
    讨论结果
    本学期《软件需求分析》需要掌握的内容(个人总结)
    第二周进度条
    四则运算
    第一周进度记录
    java web
    ke tang zuo ye
    2015-05-26 随笔
  • 原文地址:https://www.cnblogs.com/inmoonlight/p/5788081.html
Copyright © 2011-2022 走看看