zoukankan      html  css  js  c++  java
  • nyoj 274-正三角形的外接圆面积 (R = PI * a * a / 3)

    274-正三角形的外接圆面积


    内存限制:64MB 时间限制:1000ms 特判: No
    通过数:14 提交数:22 难度:0

    题目描述:

    给你正三角形的边长,pi=3.1415926 ,求正三角形的外接圆面积。

    输入描述:

    只有一组测试数据 第一行输入一个整数n(1<n<1000)表示接下来要输入n个边长m(1.0<=m<1000.0)

    输出描述:

    输出每个正三角形的外接圆面积,保留两位小数,每个面积单独占一行。
    

    样例输入:

    5
    1
    13
    22
    62
    155

    样例输出:

    1.05
    176.98
    506.84
    4025.43
    25158.92

    C/C++ AC:

     1 #include <iostream>
     2 #include <algorithm>
     3 #include <cstring>
     4 #include <cstdio>
     5 #include <cmath>
     6 #include <stack>
     7 #include <set>
     8 #include <map>
     9 #include <queue>
    10 #include <climits>
    11 #define PI 3.1415926
    12 
    13 using namespace std;
    14 const int MY_MAX = 1010;
    15 int N;
    16 
    17 int main()
    18 {
    19     cin >>N;
    20     while (N --)
    21     {
    22         double a;
    23         cin >>a;
    24         printf("%.2lf
    ", PI * a * a / 3);
    25     }
    26 }
  • 相关阅读:
    Spring 发生 has not been refreshed yet 异常
    rsyslog config
    grok
    阿里云态势
    Unity的asm笔记
    Unity2020或Unity2019安装后无法启动
    rider代码折叠
    使用rider调试lua
    MacType更好的字体渲染
    Unity字体和画面花屏处理
  • 原文地址:https://www.cnblogs.com/GetcharZp/p/9337495.html
Copyright © 2011-2022 走看看