Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- int** matr;
- matr = new int* [n];
- for (int i = 0; i < n; i++)
- {
- matr[i] = new int[n];
- for (int j = 0; j < n; j++)
- {
- cin >> matr[i][j];
- if (j >= i)
- matr[i][j] = 1;
- }
- }
- for (int i = 0; i < n; i++)
- {
- for (int j = 0; j < n; j++)
- cout << matr[i][j] << " ";
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement