nyoj 274-正三角形的外接圆面积 (R = PI * a * a / 3)
Posted getcharzp
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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 }
以上是关于nyoj 274-正三角形的外接圆面积 (R = PI * a * a / 3)的主要内容,如果未能解决你的问题,请参考以下文章