Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Disclaimer: The creator of 'C# Shell (C# Offline Compiler)' is in no way responsible for the code posted by any user.
- using System;
- using System.IO;
- using System.Linq;
- using System.Collections.Generic;
- namespace HW
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[,] array = new int[10,10];
- Random rnd = new Random();
- int kj = 0;
- int k =0;
- for(int i= 0; i < array.GetLength(0);i++)
- {
- for(int j = 0 ; j < array.GetLength(1); j++)
- {
- int initNum = rnd.Next(5,500);
- array [i,j] = initNum;
- kj= array[i,j] ;
- Console.Write(" "+kj);
- }
- Console.WriteLine();
- }
- for(int i= 0; i < array.GetLength(0);i++)
- {
- for(int j = 0 ; j < array.GetLength(1); j++)
- {
- k = array[i,j];
- if (array[i,j]>array[i, j +1])
- {
- k= array[i,j];
- }
- else if(array[i,j]<array[i, j +1])
- {
- k = array[i,j+1];
- }
- Console.Write(" " + array[i,j]);
- }
- Console.WriteLine();
- }
- Console.WriteLine(k) ;
- }
- }
- }
Add Comment
Please, Sign In to add comment