18 lines
339 B
C++
18 lines
339 B
C++
|
#include<iomanip>
|
||
|
setprecision(n)
|
||
|
double a=123.56789;
|
||
|
cout<<a<<endl;
|
||
|
cout<<setprecision(1)<<fixed<<a<<endl;
|
||
|
cout<<setprecision(2)<<fixed<<a<<endl;
|
||
|
cout<<setprecision(3)<<fixed<<a<<endl;
|
||
|
cout<<setprecision(4)<<fixed<<a<<endl;
|
||
|
cout<<setprecision(5)<<fixed<<a<<endl;
|
||
|
cout<<setprecision(6)<<fixed<<a<<endl;
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
return 0;
|
||
|
}
|