fork(1) download
  1. #include <iostream>
  2. #include <locale>
  3.  
  4. struct threes : std::numpunct<char>
  5. {
  6. std::string do_grouping() const { return "\3"; }
  7. };
  8.  
  9. int main()
  10. {
  11. std::cout.imbue(std::locale(std::cout.getloc(), new threes));
  12. std::cout << 123456789 << '\n';
  13. }
  14.  
Success #stdin #stdout 0s 3432KB
stdin
Standard input is empty
stdout
123,456,789