/
Ikocs
/
cpp-tasks
Обзор
Документация
Войти
/
Ikocs
/
cpp-tasks
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
18_all_of_example/main.cpp
26 строк
643 B
Alexey Elfimov
Init commit
16 сен 2024, 14:45
16 сен 2024, 14:45
08b7ab0
Код
Авторство
О чём код?
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { vector<int> v1{1,3,5,7,19,99,123,89}; vector<int> v2{1,3,5,7,19,99,123,89,8}; short delimeter = 2; if(all_of(v1.cbegin(), v1.cend(), [&](const auto& value){ return value % delimeter != 0; })) cout << "V1 - correct vector" << endl; else cout << "V1 - NOT correct vector" << endl; if(all_of(v2.cbegin(), v2.cend(), [&](const auto& value){ return value % delimeter != 0; })) cout << "V2 - correct vector" << endl; else cout << "V2 - NOT correct vector" << endl; return 0; }