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.Threading.Tasks;
- namespace Задание_1_Массивы
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[,] array = {
- { 1,4,7},
- { 2,7,8},
- { 3,6,9}
- };
- for (int i = 0; i < 3; i++)
- {
- for (int j = 0; j < 3; j++)
- Console.Write(String.Format(array[i, j] + " "));
- Console.WriteLine();
- }
- for (int i = 0; i < 3; i++)
- for (int j = 0; j < 3 - 1; j++)
- for (int g = 0; g < 3; g++)
- if (array[j, g] < array[j + 1, g])
- {
- int temp = array[j, g];
- array[j, g] = array[j + 1, g];
- array[j + 1, g] = temp;
- }
- for (int i = 0; i < 3; i++)
- {
- for (int j = 0; j < 3; j++)
- Console.Write(String.Format(array[i, j] + " "));
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement