1 条题解
-
0
C :
#include<stdio.h> #define PI 3.14 int main() { float r,h,l,s1,v1,s2,v2; scanf("%f%f",&r,&h); l=2*PI*r; s1=PI*r*r; v1=s1*h; s2=4*PI*r*r; v2=(4.0/3.0)*PI*r*r*r; printf("C1=%.2lf\nSa=%.2lf\nSb=%.2lf\nVa=%.2lf\nVb=%.2lf\n",l,s1,s2,v2,v1); return 0; }
C++ :
#include<iostream> #include<iomanip> using namespace std; #define PI 3.14; int main() {float r,h;scanf("%f %f",&r,&h);float a,b,c,d,e; a=2*r*PI;b=r*r*PI;c=4*r*r*PI;d=4.0/3*r*r*r*PI;e=h*r*r*PI; cout<<fixed<<setprecision(2)<<"C1="<<a<<endl<< "Sa="<<b<<endl<<"Sb="<<c<<endl<<"Va="<<d<<endl<<"Vb="<<e<<endl; return 0;}
- 1
信息
- ID
- 1411
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- (无)
- 标签
- (无)
- 递交数
- 0
- 已通过
- 0
- 上传者