12-04-03.cpp
来自「more efftive 代码」· C++ 代码 · 共 21 行
CPP
21 行
#include <iostream>#include <vector>#include <algorithm>#include <functional>#include <cassert>using namespace std;int main(){ vector<int> V1; V1.push_back(1); V1.push_back(2); V1.push_back(3); V1.push_back(1); vector<int> V2(V1.size()); replace_copy(V1.begin(), V1.end(), V2.begin(), 1, 99); assert(V2[1] == V1[1] && V2[2] == V1[2]); assert(V2[0] == 99 && V2[3] == 99);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?