游客 Signup | Login
中文 | En

2693 - 天才小熊猫

作为学IT的精英人才,平时一定要注意保持体形。否则很有可能发生形变,比如成为这样:

<span style="font-size:10.5pt;font-family:'Times New Roman';">虽然熊猫看上去很可爱,不过胖成球就不太好了<span>……</span></span><span style="font-size:10.5pt;font-family:'Times New Roman';"></span>

<span style="font-size:10.5pt;font-family:'Times New Roman';">对了,输入球的半径,你还会计算球的体积吗?</span><span style="font-size:10.5pt;font-family:'Times New Roman';"></span>

<span style="font-size:10.5pt;font-family:'Times New Roman';">我们在这里设定<span>π</span><span>为</span><span>3.1415927</span><span>。</span></span><span style="font-size:10.5pt;font-family:'Times New Roman';"></span>

Input

第一行T,表示有T组数据。

接下来T行,每行由一个数k组成(0.00<k<10000.00),表示球的半径

Output

每组输出一个数字,表示球的体积。结果保留三位小数。

Examples

Input

2
1
1.5

Output

4.189
14.137

Solution C

#include<stdio.h>
int main()
{
	double a,b,v;
	double t=3.1415927;
	int i;
	scanf("%lf",&a);
	for(i=0;i<a;i++)
	{
		scanf("%lf",&b);
		v=t*b*b*b*4.0/3.0;
		printf("%.3f\n",v);
	}
}

Solution C++

#define PI 3.1415927
#include <iostream>
#include <cmath>
#include <iomanip>
#include <fstream>
using namespace std;
int main()
{
    //ifstream cin;
    //ofstream cout;
    int testcase;
    //cin.open("b.in");
    //cout.open("b.out");
    double a;
    cin>>testcase;
    while(testcase--)
    {
        cin>>a;
        cout<<setiosflags(ios::fixed)<<setprecision(3)<<(4/3.0)*PI*pow(a,3.0)<<endl;
    }

    return 0;
}

Time Limit 1 second
Memory Limit 32 MB
Discuss Stats
上一题 下一题