1 条题解
-
0
C :
#include <stdio.h> void main() { double i,r,s,p=3.14; scanf("%lf",&i); r=i/2.0/p; s=3.14*r*r; printf("%.2f",s); }C++ :
#include<bits/stdc++.h> using namespace std; int main(){ double s,c,r,pi = 3.14; cin>>c; r = c / (2 * pi); s = pi * r * r; cout<<fixed<<setprecision(2)<<s<<endl; return 0; }Pascal :
var c,s:real; begin read(c); s:=c/6.28; s:=s*s*3.14; write(s:0:2); end.Java :
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double x = sc.nextDouble(); double pi = 3.14; //定义面积为s double s ; double r = x /(2*pi); s = pi * r * r; System.out.printf("%.2f",s); } }Python :
# 接受输入周长 x = float(input()) # 圆周率3.14 p = 3.14 # 计算半径 r = x / (2 * p) # 计算面积 s = r * r * p print('%.2f' % s)
- 1
信息
- ID
- 317
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- (无)
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者