fork download
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <string>
  4.  
  5.  
  6. void printStuff(const std::string& color) {
  7. //std::cout << "|" << std::setw(10) << std::left << color << "|\n";
  8. std::cout << "|" << std::setw(8) << std::right << color << std::setw(3) << "|" << std::endl;
  9. }
  10.  
  11. int main() {
  12. printStuff("Red-1");
  13. printStuff("Green-2");
  14. printStuff("NIR-3");
  15. printStuff("FIR-2");
  16. }
Success #stdin #stdout 0.01s 5276KB
stdin
Standard input is empty
stdout
|   Red-1  |
| Green-2  |
|   NIR-3  |
|   FIR-2  |