运行 ❯
获取你的
自己的
网站
×
更改方向
更改主题,深色/浅色
转到 Spaces
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { vector<int> numbers = {1, 7, 3, 5, 3, 9, 2}; vector<int> search = {2, 3, 5}; // Sort the numbers vector sort(numbers.begin(), numbers.end()); // Check if 'search' vector is included in 'numbers' if (includes(numbers.begin(), numbers.end(), search.begin(), search.end())) { cout << "Found"; } else { cout << "Not found"; } return 0; }
已找到