1 条题解
-
0
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); }
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; }
Pascal :
program aa; var a,b,c,d,e:real; begin read(a); b:=3.1415926; c:=a*a*b; d:=a*2*b; write(c:0:2); writeln; write(d:0:2); end.
- 1
信息
- ID
- 323
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 10
- 标签
- 递交数
- 1
- 已通过
- 1
- 上传者