Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace IMJunior
- {
- class Program
- {
- static void Main(string[] args)
- {
- Random rand = new Random();
- const int N = 10;
- int I=0, J=0,Max=0;
- int[,] B = new int[N, N];//матрица ранодмных чисел
- int[,] A = new int[N, N];//полученная матрица
- for (int i = 0; i < N; i++)
- {
- for (int j = 0; j < N; j++)
- {
- A[i, j] = rand.Next(0, 100);
- Console.Write(A[i, j] + " ");
- B[i, j] = A[i, j];
- if (A[i, j] > Max)
- {
- Max = A[i, j];
- I = i;
- J = j;
- }
- }
- Console.WriteLine();
- }
- Console.WriteLine("Максимальный элемент = "+Max);
- B[I, J] = 0;
- for (int i = 0; i < N; i++)
- {
- for (int j = 0; j < N; j++)
- {
- Console.Write(B[i, j] + " ");
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment