fork(12) download
  1. #include <iostream>
  2. #include <locale>
  3. #include <vector>
  4.  
  5. using namespace std;
  6.  
  7. struct csv_reader: ctype<char> {
  8. csv_reader(): ctype<char>(get_table()) {}
  9. static ctype_base::mask const* get_table() {
  10. static vector<ctype_base::mask> rc(table_size, ctype_base::mask());
  11.  
  12. rc[' '] = ctype_base::space;
  13. rc[','] = ctype_base::space;
  14. rc['/'] = ctype_base::space;
  15. rc['\n'] = ctype_base::space;
  16. return &rc[0];
  17. }
  18. };
  19.  
  20. int main() {
  21.  
  22. int a,b,c;
  23.  
  24. cin.imbue(std::locale(std::locale(), new csv_reader()));
  25. cin >> a >> b >> c;
  26. cout << a << b << c;
  27.  
  28. return 0;
  29. }
Success #stdin #stdout 0s 2992KB
stdin
123 / 456, 789
stdout
123456789