Код: Выделить всё
for(int i = 0; i < this.lastPosition; i++)
{
if(this.list[i].GetName().CompareTo(this.list[i+1].GetName()) > 0) {
Student temp = this.list[i];
this.list[i] = this.list[i+1];
this.list[i+1] = temp;
}
}
Код: Выделить всё
Rina 034377281 Parent: Rozz 044377281
Bina 034377281 Parent: Rozz 044377281
Cina 034377281 Parent: Noa 050569126
Код: Выделить всё
Bina 034377281 Parent: Rozz 044377281
Cina 034377281 Parent: Noa 050569126
Cina 034377281 Parent: Noa 050569126
Код: Выделить всё
public class StudentList
{
public const int MaxStudent = 38;
private Student[] list;
private int lastPosition;
Код: Выделить всё
public class Student
{
private string name;
private string phoneNum;
Parent parent;
Подробнее здесь: https://stackoverflow.com/questions/790 ... st-c-sharp
Мобильная версия