Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- internal class Program
- {
- private const int N = 12;
- private static void Main()
- {
- var matrix = new int[N, N];
- var rand = new Random();
- for (var i = 0; i < N; i++)
- for (var j = 0; j < N; j++)
- matrix[i, N - j - 1] = i <= j ? 0 : rand.Next(1, 9);
- for (var i = 0; i < N; i++)
- {
- for (var j = 0; j < N; j++)
- {
- if (matrix.Length > N - j - 1)
- matrix[i, N - j - 1] = i <= j ? 0 : rand.Next(1, 9);
- Console.Write(matrix[i, j] + " ");
- }
- Console.WriteLine();
- }
- Console.WriteLine();
- for (var i = 0; i < N; i++)
- {
- for (var j = 0; j < N; j++)
- {
- Console.Write(matrix[j, i] + " ");
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement