fork(1) download
  1. #include <iostream>
  2. #include <iomanip>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. double d = 12.3321;
  9. cout
  10. << setprecision(6) << d << endl
  11. << setprecision(4) << d << endl
  12. << setprecision(6) << d << endl;
  13.  
  14. }
  15.  
Success #stdin #stdout 0s 4388KB
stdin
Standard input is empty
stdout
12.3321
12.33
12.3321