W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
#include
#include
#include
using namespace std; bool has_o(string item) { return item.find('o') != string::npos; } int main() { vector
cars = {"Volvo", "BMW", "Ford", "Tesla"}; replace_if(cars.begin(), cars.end(), has_o, (string)"Toyota"); for (string car : cars) { cout << car << "\n"; } return 0; }