Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _1._MatrixInputOutput
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- int rows = int.Parse(Console.ReadLine());
- int cols = int.Parse(Console.ReadLine());
- int[,] numbers = new int[rows, cols];
- //input matrix
- for (int row = 0; row <= rows - 1; row++)
- {
- for (int col = 0; col <= cols - 1; col++)
- {
- numbers[row, col] = int.Parse(Console.ReadLine());
- }
- }
- //output matrix
- for (int row = 0; row <= rows - 1; row++)
- {
- for (int col = 0; col <= cols - 1; col++)
- {
- Console.Write(numbers[row, col] + " ");
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment