Ответы на вопрос:
#include < iostream> #include < stdlib.h> #include < time.h> using namespace std; const int n = 10; int main() { int a[n][n]; cout < < "source array: \n"; srand(time(null)); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { a[i][j] = rand() % 500 + 100; cout < < a[i][j] < < " "; } cout < < endl; } cout < < "new array: \n"; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if ((a[i][j] % 2 == 0) & & (i == j)) a[i][j] = 100; cout < < a[i][j] < < " "; } cout < < endl; } //system("pause"); return 0; }
Популярно: Информатика
-
zhaslanovd12.08.2020 16:39
-
Kulichok1423.03.2021 03:38
-
Айка111111678924.05.2022 11:45
-
igor1337d13.05.2021 05:18
-
Пикачу2445611.09.2022 23:31
-
VaLerusyaK17.02.2023 17:17
-
andreykotov607.10.2020 00:52
-
пух856404.09.2020 18:07
-
Лёха124323227.02.2023 02:08
-
36kot36124.04.2022 20:09