运行 ❯
获取您
自己的
网站
×
更改方向
更改主题,深色/浅色
进入空间
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { vector<int> numbers = {1, 7, 3, 5, 9, 2}; vector<int> search = { 2, 3, 9 }; auto it = find_first_of(numbers.begin(), numbers.end(), search.begin(), search.end()); if (it != numbers.end()) { cout << "The number " << *it << " was found!"; } else { cout << "None of the values were found."; } return 0; }
找到了数字 3!