正三角形的外接圆面积

xiaoxiao2021-02-28  94

正三角形的外接圆面积

时间限制: 1000 ms  |  内存限制: 65535 KB 难度: 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 来源 [zinber]原创 上传者

zinber

代码:

#include <iostream> #include <stdio.h> #include <string.h> #include <math.h> #include <vector> #include <queue> #include <stack> #include <map> #include <string> #include <algorithm> #define PAI 3.1415926 using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char** argv) { int n; scanf("%d",&n); while(n--){ double h; scanf("%lf",&h); printf("%.2lf\n",PAI*h*h/3); } return 0; }

转载请注明原文地址: https://www.6miu.com/read-83131.html

最新回复(0)