Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace methods_7
- {
- class Program
- {
- static void Main(string[] args)
- {
- int number = int.Parse(Console.ReadLine());
- Matrix(number);
- }
- private static void Matrix(int num)
- {
- int rows = num;
- int columns = num;
- int[,] matrix = new int[rows, columns];
- Enumerable.Range(0, rows).ToList().ForEach(row => Enumerable.Range(0, columns).ToList().ForEach(column =>
- {
- matrix[row, column] = 2;
- Console.Write(column == columns ? Environment.NewLine + matrix[row, column].ToString() + "\t" : matrix[row, column].ToString() + "\t");
- }));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement