Advertisement
Vadim_Rogulev

Untitled

Apr 17th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.77 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 Наибольший_элемент
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int[,] array = {{ 1, 2, 3 },{ 4, 12, 6 },{ 7, 8, 9 }};
  14.             int max = int.MinValue;
  15.             for(int i = 0; i < array.GetLength(0); i++)
  16.             {
  17.                 for (int j = 0; j < array.GetLength(1); j++)
  18.                 {
  19.                     Console.WriteLine(array[i, j]);
  20.                     if (array[i, j] > max)
  21.                     {
  22.                         max = array[i, j];
  23.                     }
  24.                 }
  25.             }
  26.             Console.WriteLine(max);
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement