Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- #include <format>
- using namespace std;
- int main()
- {
- SetConsoleOutputCP(1251);
- int const n{ 4 };
- int i{}, j{};
- int W[n][n]{
- {1, 3, -9, 0},
- {-4, 6, 2, -5},
- {3, 7, 0, 6},
- {-3, 9, 11, -2} };
- cout << "Початкова матриця: " << endl;
- for (i = 0; i < n; i++) {
- for (j = 0; j < n; j++) {
- cout << format("{:5}", W[i][j]);
- }
- cout << endl;
- }
- cout << "Перетворена матриця: " << endl;
- for (i = 0; i < n; i++) {
- for (j = 0; j < n; j++) {
- if (W[i][j] < 3) {
- W[i][j] = 8;
- }
- cout << format("{:5}", W[i][j]);
- }
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement