#include < iostream > #include < windows.h > #include < algorithm > #include < ctime > #include < cstdlib > using namespace std; int main() { SetConsoleCP(1251); SetConsoleOutputCP(1251); srand(time(NULL)); system("color 0A"); unsigned arr[10]; auto gen = []() { return 7 + rand() % (14 - 7 + 1); }; auto show = [](unsigned t) { cout << t << " "; }; auto editor = [](unsigned &t) { if (t % 7 == 0) { t = 0; } }; generate(arr, arr + 10, gen); cout << "Исходный массив: " << endl; for_each(arr, arr + 10, show); cout << endl; for_each(arr, arr + 10, editor); cout << "Преобразованный массив: " << endl; for_each(arr, arr + 10, show); cout << endl; system("pause"); return 0; }