Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- Console.Write("Hello please enter the max number: ");
- int max = int.Parse(Console.ReadLine());
- Console.Write("\nHello please enter the min number: ");
- int min = int.Parse(Console.ReadLine());
- Random rnd = new Random();
- int[,] math = new int[max, min];
- for (int i = 0; i < math.GetLength(0); i++)
- {
- for (int j = 0; j < math.GetLength(1); j++)
- {
- math[i,j] = rnd.Next(20,101);
- }
- }
- for (int i = 0; i < math.GetLength(0); i++)
- {
- for (int j = 0; j < math.GetLength(1); j++)
- {
- Console.Write("[{0},{1}]={2}\t", i, j, math[i, j]);
- }
- }
- methMax(math);
- methMin(math);
- methRaw();
- methColum();
- }
- private static void methColum()
- {
- throw new NotImplementedException();
- }
- private static void methRaw()
- {
- throw new NotImplementedException();
- }
- private static int methMin(int[,] math)
- {
- int minnum = 99999999;
- for (int i = 0; i < math.GetLength(0); i++)
- {
- for (int j = 0; j < math.GetLength(1); j++)
- {
- if (math[i, j] < minnum)
- {
- minnum = math[i, j];
- }
- }
- }
- return minnum;
- }
- static int methMax( int[,] math)
- {
- int maxnum = 0;
- for (int i = 0; i < math.GetLength(0); i++)
- {
- for (int j = 0; j < math.GetLength(1); j++)
- {
- if (math[i,j] > maxnum)
- {
- maxnum = math[i, j];
- }
- }
- }
- return maxnum;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement