fork download
  1. #include <vector>
  2. #include <string>
  3. #include <iostream>
  4. #include <iomanip>
  5.  
  6. using namespace std;
  7.  
  8. double v[] =
  9. {
  10. 1.0, 33.15, 30/3.0, 2.718281828
  11. };
  12.  
  13. int main(int argc, const char * argv[])
  14. {
  15. for(auto x: v)
  16. {
  17. cout << fixed << right << setprecision(8) << setw(12) << x << endl;
  18. }
  19. }
  20.  
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
  1.00000000
 33.15000000
 10.00000000
  2.71828183