Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int N;
- setlocale(LC_ALL, "Russian");
- int mas[100][100];
- cout << "Введите размер матрицы: "; cin >> N;
- cout << "Исходная матрица\n";
- for (int i = 0; i < N; i++) {
- for (int j = 0; j < N; j++) {
- mas[i][j] = 1;
- cout << mas[i][j] << " ";
- }
- cout << endl;
- }
- cout << endl;
- cout << "Преобразованная матрица\n";
- for (int i = 0; i < N; i++)
- for (int j = N-i-1; j < N; j++)
- mas[i][j] = 0;
- for (int i = 0; i < N; i++) {
- for (int j = 0; j < N; j++) {
- cout << mas[i][j] << " ";
- }
- cout << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment