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"}; vector
newcars(4); replace_copy_if(cars.begin(), cars.end(), newcars.begin(), has_o, (string)"Toyota"); for (string car : newcars) { cout << car << "\n"; } return 0; }