#include #include #include int main(void) { const int n = 5; int a[n][n]; srand(time(NULL)); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { a[i][j] = rand() % 1000; printf("%d ", a[i][j]); } printf("\n"); } printf("\n"); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (i == j) a[i][j] = i+1; printf("%d ", a[i][j]); } printf("\n"); } return 0; }