Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace Meshok_s_troubles
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Введите размеры матрицы");
- int n = int.Parse(Console.ReadLine());
- Console.WriteLine("Введите элементы");
- var list = new List<List<int>>();
- for (int i = 0; i < n; i++)
- {
- list.Add(new List<int>());
- for (int j = 0; j < n; j++)
- list[i].Add(int.Parse(Console.ReadLine()));
- }
- for (int i = 0; i < n; i++)
- for (int j = n - 1; j > i; j--)
- {
- if (list[i][j] == 0)
- {
- list[i].Clear();
- break;
- }
- }
- for (int i = 0; i < list.Count; i++)
- for (int j = 0; j < list[i].Count; j++)
- {
- Console.Write(list[i][j]);
- if (j == n - 1)
- Console.WriteLine();
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment