#include#include int main() { int mat[2][2] = {{1, 2}, {3, 4}}; matrix_zero::set_zero(mat, 2, 2); for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { std::cout << mat[i][j] << " "; } std::cout << std::endl; } return 0; }
0 0 0 0
#include#include int main() { int cube[2][2][2] = {{{1, 2}, {3, 4}}, {{5, 6}, {7, 8}}}; matrix_zero::set_zero(cube, 2, 2, 2); for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { for (int k = 0; k < 2; k++) { std::cout << cube[i][j][k] << " "; } std::cout << std::endl; } std::cout << std::endl; } return 0; }
0 0 0 0 0 0 0 0The Matrix Zero package library is not a part of the standard C++ library, so it needs to be downloaded and installed separately. One possible package library that can be used for this purpose is Boost, which provides various libraries for C++ programming. However, it is also possible to create a custom implementation of the Matrix Zero algorithm for specific use cases.