fork download
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. #include <algorithm>
  5.  
  6. char op_replace_comma(char c)
  7. {
  8. if (c == ',') return ' ';
  9. else return c;
  10. }
  11.  
  12. int main()
  13. {
  14. std::ifstream in("Input.txt");
  15. std::ofstream out("Output.txt");
  16. std::string str;
  17. while (in >> str) {
  18. std::transform(str.begin(), str.end(), str.begin(), op_replace_comma);
  19. out << str << std::endl;;
  20. }
  21.  
  22. in.close();
  23. out.close();
  24.  
  25. return 0;
  26. }
Success #stdin #stdout 0s 4536KB
stdin
Standard input is empty
stdout
Standard output is empty