c++,帮我改改,让体积的结果精确到小数点后三位,谢谢!
#include<iostream>using namespace std;
int main()
{
int r,h;
cout<<"please input two number:"<<'\n';
cin>>r>>h;
cout<<"radious:"<<r<<"high:"<<h<<endl;
double v=3.14*r*r*h;
cout<<"The volume is:"<<v<<endl;
return 0;
}帮我改改,让体积的结果精确到小数点后三位,谢谢!{:5_109:} 顶!d=====( ̄▽ ̄*)b cout.setf(ios::fixed);
cout<<setprecision(3)<<"The volume is:"<<v<<endl;
cout.unsetf(ios::fixed);
格式输出,应该不陌生吧?
页:
[1]