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