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;
- namespace Learn1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[,] array = new int[10, 10];
- Random rand = new Random();
- int maxValue = int.MinValue;
- int[,] arr = new int[10, 10];
- for (int i = 0; i < array.GetLength(0); i++)
- {
- for (int j = 0; j < array.GetLength(1); j++)
- {
- array[i, j] = rand.Next(0, 50);
- }
- }
- Console.WriteLine("Исходная Матрица:");
- for (int i = 0; i < array.GetLength(0); i++)
- {
- for (int j = 0; j < array.GetLength(1); j++)
- {
- Console.Write(array[i, j] + " ");
- if (maxValue < array[i, j])
- {
- maxValue = array[i, j];
- }
- }
- Console.WriteLine();
- }
- Console.WriteLine("Наибольший элемент: " + maxValue);
- Console.WriteLine("Полученная матрица:");
- for (int i = 0; i < arr.GetLength(0); i++)
- {
- for (int j = 0; j < arr.GetLength(1); j++)
- {
- arr[i, j] = array[i, j];
- Console.Write(arr[i, j] + " ");
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement