執行 ❯
建立您
自己的
網站
×
更改方向
更改主題,深色/淺色
前往 Spaces
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { vector<string> cars = {"Volvo", "BMW", "Ford", "Mazda"}; replace(cars.begin(), cars.end(), (string)"Ford", (string)"Toyota"); for (string car : cars) { cout << car << "\n"; } return 0; }
沃爾沃
寶馬
豐田
Mazda