include iostream include algorithm include string using namespace std

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main() {
string word;
cout << "Please enter the word from which you want to remove the letter o" << endl << "Entered word: ";
getline(cin, word);
word.erase(remove(word.begin(), word.end(), 'o'), word.end());
std::cout << "Result: " << word << endl;
}