Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- class Program
- {
- static void Main()
- {
- Console.WriteLine("Enter numbers of rows: ");
- int rows = int.Parse(Console.ReadLine());
- Console.WriteLine("Enter numbers of cols: ");
- int cows = int.Parse(Console.ReadLine());
- int[,] matrix = new int[rows, cows];
- for (int row = 0; row < rows; row++)
- {
- for (int cow = 0; cow < cows; cow++)
- {
- Console.Write("Element {0}{1} is: ", row, cow);
- int element = int.Parse(Console.ReadLine());
- matrix[row, cow] = element;
- }
- }
- Console.WriteLine("The filled matrix is: ");
- for (int row = 0; row < rows; row++)
- {
- for (int cow = 0; cow < cows; cow++)
- {
- Console.Write("{0} ", matrix[row, cow]);
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement