0
已解决
潘晨皓
高级天翼
高级天翼
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
double a,s,v;
cin>>a;
s=3.14*a*a;
v=4/3*3.14*a*a*a;
cout<<s<<"\n"<<v;
return 0;
}
为何第二个样例错了?
潘晨皓在2020-06-16 17:14:22追加了内容
快快快!!!
潘晨皓在2020-06-16 17:33:57追加了内容
快啊!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
为什么没人回答!
0
已采纳
杨睿
修练者
修练者
int main(){
double r;//半径
cin>>r;
printf("%.1f",(整型)(3.14*半径*半径*10+0.5)/10.0);
cout<<endl;
printf("保留两位小数",(整型)(4.0/3*3.14*半径*半径*半径*100+0.5)/100.0);
return 0;
}
望采纳awa
0
0
0
王泽宇
初级光能
初级光能
s=3.14*r*r;
v=4.0/3*3.14*r*r*r;
printf("%.1f\n",int(s*10+0.5)/10.0);
cout<<endl;
printf("%.2f",int(v*100+0.5)/100.0);
0