Run ❯
Get your
own
website
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
#include
#include
#include
using namespace std; bool has_o(string item) { return item.find('o') != string::npos; } int main() { vector
cars = {"Volvo", "BMW", "Ford", "Mazda"}; replace_if(cars.begin(), cars.end(), has_o, (string)"Toyota"); for (string car : cars) { cout << car << "\n"; } return 0; }
Toyota
BMW
Toyota
Mazda