#include <iostream>
#include <algorithm>
int main() {
const int N = 3, k = 2, matrix[N][N] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
std::for_each(matrix[k], matrix[k] + N, [d = matrix[k][k]](int& i){ i /= d; });
for(auto& i : matrix) {
for(auto j : i) std::cout << j << " ";
std::cout << '\n';
}
}