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.Text.RegularExpressions;
- using System.Threading.Tasks;
- namespace ConsoleTest
- {
- class Program
- {
- static void Main()
- {
- int max = 0;
- int m, n;
- Random random = new Random();
- m = 0;
- while(m < 1)
- {
- m = Convert.ToInt32(Console.ReadLine());
- }
- n = 0;
- while (n < 1)
- {
- n = Convert.ToInt32(Console.ReadLine());
- }
- double maxNumber;
- List<double> numbers = new List<double>();
- double[,] A = new double[m, n];
- double[,] B = new double[m, n];
- for (int i = 0; i < m; i++)
- {
- for (int j = 0; j < n; j++)
- {
- A[i, j] = random.Next(-100, 100)/*Convert.ToDouble(Console.ReadLine());*/;
- numbers.Add(Math.Abs(A[i, j]));
- }
- }
- maxNumber = numbers.Max();
- for (int i = 0; i < m; i++)
- {
- for (int j = 0; j < n; j++)
- {
- B[i, j] = A[i, j]/maxNumber;
- }
- }
- Console.WriteLine($"Найболшьшое число в матрице А - {maxNumber}");
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement