W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
#include
#include
#include
using namespace std; bool greater_than_5(int value) { return value > 5; } int main() { vector
numbers = {1, 7, 3, 5, 9, 2}; int amount = count_if(numbers.begin(), numbers.end(), greater_than_5); cout << "共有 " << amount << " 个大于 5 的值。"; return 0; }