class Student : IComparable<Student>
fio = "Донцова Дарья Алексеевна";
specialty = "Программист";
public Student(string fio, string specialty, int course)
this.specialty = specialty;
Console.WriteLine("{0} {1} {2}", fio, specialty, course);
public int CompareTo(Student other)
return course.CompareTo(other.course);
public static void Main()
int[] array = { 4, 2, 3, 4, 5, 6 };
double[] array2 = { 4.2, 3.4, 4.5, 6.7 };
Console.WriteLine("Минимальный элемент 1 массива -> {0}", GetMinElement(array));
Console.WriteLine("Минимальный элемент 2 массива -> {0}", GetMinElement(array2));
Student[] students = new Student[4];
students[0] = new Student("Мигалкин Петр Макчимович", "Техник-программист", 2);
students[1] = new Student("Андреев Андей Юрьевич", "Техник", 4);
students[2] = new Student("Куроптев Николай Александрович", "Связист", 3);
students[3] = new Student("Михайльчук Тимофей Петрович", "Радист", 1);
Console.WriteLine("ВЫВОД МАССИВА: ");
for (int i = 0; i < 4; i++)
Console.WriteLine("ВЫВОД ОТСOРТИРОВАННОГО МАССИВА:");
Array.Sort<Student>(students);
for (int i = 0; i < 4; i++)
static void GetArray<T>(T[] arr)
Console.WriteLine("Массив:");
for (int i = 0; i < arr.Length; i++)
Console.Write("{0} ", arr[i]);
static T GetMinElement<T>(T[] arr) where T : IComparable
for (int i = 0; i < arr.Length; i++)
if (i != arr.Length - 1 && arr[i].CompareTo(arr[i + 1]) == 1)