运行 ❯
获取您
自己的
网站
×
更改方向
更改主题,亮色/深色
转到 Spaces
#include <iostream> #include <vector> #include <algorithm> using namespace std; bool greater_than_10(int value) { return value > 10; } int main() { vector<int> numbers = {1, 7, 3, 5, 9, 2}; if (none_of(numbers.begin(), numbers.end(), greater_than_10)) { cout << "None of the numbers are greater than 10"; } else { cout << "Some numbers are greater than 10"; } return 0; }
没有一个数字大于 10