Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- void printMatrix(int l, int n, double *A, int r) {
- int rows_to_show = std::min(l, r);
- int cols_to_show = std::min(n, r);
- for (int i = 0; i < rows_to_show; ++i) {
- for (int j = 0; j < cols_to_show; ++j) {
- std::cout << " " << std::scientific << std::setprecision(3) << A[i * n + j];
- }
- std::cout << std::endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment