fork download
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <cstdio>
  4. using namespace std;
  5.  
  6. int main() {
  7. cout << setfill('0') << setw(6) << setprecision(2) << 123.456 << endl;
  8.  
  9. printf("%06.02lf", 123.456);
  10. return 0;
  11. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
1.2e+02
123.46