运行 ❯
获取您自己的网站
×
更改方向
更改主题,深色/浅色
转至 Spaces
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { vector<int> numbers = {1, 7, 3, 5, 9, 2}; vector<int> target = {3, 5, 9}; if (search(numbers.begin(), numbers.end(), target.begin(), target.end()) != numbers.end()) { cout << "Target was found"; } else { cout << "The target was not found"; } return 0; }
找到目标