Руководство по стандартной библиотеке шаблонов STL

bool odd


#include <stl.h> #include <iostream.h>

bool odd (int a_) { return a_ % 2; }

int numbers[6] = { 1, 2, 3, 1, 2, 3 }; int result[6] = { 0, 0, 0, 0, 0, 0 };

int main () { remove_copy_if (numbers, numbers + 6, result, odd); for (int i = 0; i < 6; i++) cout << result[i] << ' '; cout << endl; return 0; }


Содержание раздела