fork download
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. int main() {
  6. string word;
  7. cin >> word;
  8. if(word.length() > 64)
  9. {
  10. cout << "Word is too long.." << endl;
  11. return 0;
  12. }
  13. while(word != "quit!")
  14. {
  15. if(word.length() > 4 && word.length() <= 64)
  16. if(word[word.length() - 2] == 'o' && word[word.length() - 1] == 'r')
  17. word.insert(word.length() - 1, "u");
  18. cout << word << endl;
  19. cin >> word;
  20. if(word.length() > 64)
  21. {
  22. cout << "Word is too long.." << endl;
  23. return 0;
  24. }
  25. }
  26. return 0;
  27. }
Success #stdin #stdout 0s 3432KB
stdin
Hello
Lol
For
Taylor
color
quit!
stdout
Hello
Lol
For
Taylour
colour