fork(1) download
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. float a=3.46,b=4.72;
  8. cout.setf(ios::fixed);
  9. cout.precision(2);
  10. cout<<a<<'\t'<<b<<endl;
  11. cout.precision(1);
  12. cout<<a<<'\t'<<b<<endl;
  13. cout.precision(0);
  14. cout<<a<<'\t'<<b<<endl;
  15. return 0;
  16. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
3.46	4.72
3.5	4.7
3	5