fork(1) download
  1. #include <iostream>
  2. #include <iomanip>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int a = 45;
  9. float b = 45.323;
  10. double c = 45.5468;
  11. int aa = a + 9;
  12. float bb = b + 9;
  13. double cc = c + 9;
  14. int aaa = aa + 9;
  15. float bbb = bb + 9;
  16. double ccc = cc + 9;
  17.  
  18. // 2nd attempt :>
  19.  
  20. cout << "\n\n\n" << "// 2nd attempt :>" << "\n";
  21. cout << "12345678901234567890123456789012345678901234567890" << "\n";
  22. cout << setw(15) << std::left << std::setfill(' ') << std::setw(15) << "Ints" << setw(15) << "Floats" << setw(15) << "Doubles" << "\n";
  23. cout << setw(15) << a << setw(15) << b << setw(15) << c << "\n";
  24. cout << setw(15) << std::left << std::setfill(' ') << setw(15) << aa << setw(15) << bb << setw(15) << cc << "\n";
  25. cout << setw(15) << aaa << setw(15) << bbb << setw(15) << ccc << "\n";
  26.  
  27. return 0;
  28. }
Success #stdin #stdout 0s 4468KB
stdin
Standard input is empty
stdout


// 2nd attempt :>
12345678901234567890123456789012345678901234567890
Ints           Floats         Doubles        
45             45.323         45.5468        
54             54.323         54.5468        
63             63.323         63.5468