fork download
  1. #include <iostream>
  2. #include <iterator>
  3. #include <algorithm>
  4. #include <functional>
  5. #include <string>
  6. #include <regex>
  7.  
  8. int main() {
  9. using namespace std;
  10. string input;
  11. pair<string, string> replacement_word = {
  12. "arm", "ass"
  13. };
  14. while(getline(cin, input)) {
  15. regex_replace(
  16. ostreambuf_iterator<char>(cout),
  17. begin(input), end(input),
  18. regex(replacement_word.first), replacement_word.second
  19. );
  20. cout << "\n";
  21. }
  22. return 0;
  23. }
Success #stdin #stdout 0s 3564KB
stdin
Bite my shiny metal... 
arm?
stdout
Bite my shiny metal... 
ass?