Advertisement
Guest User

3.4

a guest
May 19th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.16 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 Lesson3
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.            
  14.             int[,] array = new int[10, 10];
  15.             int max = 0;
  16.             Random rand = new Random();
  17.  
  18.  
  19.             for (int i = 0; i<10; i++)
  20.             {  
  21.                 for (int j = 0; j < 10; j++)
  22.                 {
  23.                    
  24.  
  25.                     array[i,j] = rand.Next(1,10);
  26.                    
  27.  
  28.                     //Console.Write(array[i, j] + " ");
  29.  
  30.                    
  31.                     if (max < array[i, j])
  32.                     {
  33.                         max = array[i,j];
  34.                     }
  35.                     if (array[i, j] == max)
  36.                     {
  37.                         array[i, j] = 0;
  38.                     }
  39.                     Console.Write(array[i, j] + " ");
  40.  
  41.  
  42.  
  43.                 }
  44.                
  45.                 Console.WriteLine();
  46.  
  47.                              
  48.             }
  49.             Console.WriteLine("max chislo = " + max);
  50.         }
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement