游客 Signup | Login
中文 | En

1912 - 求圆的面积和周长

  输入圆的半径,求圆的面积和周长。(圆周率=3.1415926)

Input

  一行:一个实数,表示圆的半径。

Output

  两行:

  第1行:一个实数,小数点后保留2位,表示面积

  第2行:一个实数,小数点后保留2位,表示周长

Examples

Input

1

Output

3.14
6.28

Hint

参考代码:

Solution C

#include<stdio.h>
#define PI 3.1415926
void main()
{
	double r;
	scanf("%lf",&r);
	printf("%.2f\n",PI*r*r);
	printf("%.2f\n",2*PI*r);
}

Solution C++

#include<iostream>
using namespace std;
const float pi(3.1415926);
int main()
{
    float r,s,c;
    cin>>r;
    s=pi*r*r;  
    c=2*pi*r;
    cout.precision(2);
    cout.setf(ios::fixed);
    cout<<s<<endl;
    cout<<c<<endl;
    //system("pause");
    return 0;
}

Hint

参考代码:

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