fork download
  1. #include <iostream>
  2. #include <sstream>
  3. using namespace std;
  4.  
  5. string commafyInt(size_t n)
  6. {
  7. stringstream ss;
  8. ss.imbue(std::locale(""));
  9. ss << n;
  10. return ss.str();
  11. }
  12.  
  13. int main() {
  14. // your code goes here
  15. cout << commafyInt(3313).c_str();
  16. return 0;
  17. }
Runtime error #stdin #stdout #stderr 0s 3456KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
terminate called after throwing an instance of 'std::runtime_error'
  what():  locale::facet::_S_create_c_locale name not valid