Advertisement
Guest User

3.3

a guest
Oct 21st, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.35 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace CSLight2
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int[,] matrix = new int[10, 10];
  14.             Random random = new Random();
  15.             int max = matrix[0,0];
  16.  
  17.             Console.WriteLine("Исходная матрица: ");
  18.             for (int i = 0; i < matrix.GetLength(0); i++)
  19.             {
  20.                 for (int j = 0; j < matrix.GetLength(1); j++)
  21.                 {
  22.                     matrix[i, j] = random.Next(1, 100);
  23.                     Console.Write(matrix[i, j] + " ");
  24.                 }
  25.                 Console.WriteLine();
  26.             }
  27.  
  28.             Console.WriteLine();
  29.  
  30.             Console.WriteLine("Полученная матрица:");
  31.             for (int i = 0; i < matrix.GetLength(0); i++)
  32.             {
  33.                 for (int j = 0; j < matrix.GetLength(1); j++)
  34.                 {
  35.                     //if ( )
  36.                     //max == 0;
  37.  
  38.                     Console.Write(matrix[i, j] + " ");
  39.                 }
  40.                 Console.WriteLine();
  41.             }
  42.  
  43.             Console.WriteLine();
  44.             Console.Write("Максимальное число: " + max);
  45.  
  46.             Console.ReadLine();
  47.  
  48.         }
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement