namespace ConsoleApp393
{
class Program
{
static void Main(string[] args)
{
Student[] students = new Student[]
{
new Student() { fio = "студент4", mark1 = 4, mark2 = 8, mark3 = 5 },
new Student() { fio = "студент2", mark1 = 5, mark2 = 5, mark3 = 5 },
new Student() { fio = "студент3", mark1 = 4, mark2 = 12, mark3 = 5 },
new Student() { fio = "студент5", mark1 = 4, mark2 = 1, mark3 = 5 },
};
foreach (var row in students.OrderBy(o => o.mark1 + o.mark2 + o.mark3))
{
Console.WriteLine($"{row.fio} {row.mark1} {row.mark2} {row.mark3} = {row.mark1 + row.mark2 + row.mark3}");
}
}
}
public struct Student
{
public string fio { get; set; }
public int mark1 { get; set; }
public int mark2 { get; set; }
public int mark3 { get; set; }
}
}