using System;
public class Program
{
public class Meibo
{
public int Id { get; set; }
public string Name { get; set; }
public int Age { get; set; }
}
static void Main(string[] args)
{
var meibo = new Meibo[]{
new Meibo{Age = 10},
new Meibo{Age = 50},
new Meibo{Age = 30}
};
Array.Sort(meibo, (x, y) => y.Age - x.Age);
// 結果表示
foreach (var item in meibo)
{
Console.WriteLine(item.Age);
}
}
}
dXNpbmcgU3lzdGVtOwoKcHVibGljIGNsYXNzIFByb2dyYW0KewogICAgcHVibGljIGNsYXNzIE1laWJvCiAgICB7CiAgICAgICAgcHVibGljIGludCBJZCB7IGdldDsgc2V0OyB9CiAgICAgICAgcHVibGljIHN0cmluZyBOYW1lIHsgZ2V0OyBzZXQ7IH0KICAgICAgICBwdWJsaWMgaW50IEFnZSB7IGdldDsgc2V0OyB9CiAgICB9CgogICAgc3RhdGljIHZvaWQgTWFpbihzdHJpbmdbXSBhcmdzKQogICAgewogICAgICAgIHZhciBtZWlibyA9IG5ldyBNZWlib1tdewogICAgICAgICAgICBuZXcgTWVpYm97QWdlID0gMTB9LAogICAgICAgICAgICBuZXcgTWVpYm97QWdlID0gNTB9LAogICAgICAgICAgICBuZXcgTWVpYm97QWdlID0gMzB9CiAgICAgICAgfTsKCiAgICAgICAgQXJyYXkuU29ydChtZWlibywgKHgsIHkpID0+IHkuQWdlIC0geC5BZ2UpOwoKICAgICAgICAvLyDntZDmnpzooajnpLoKICAgICAgICBmb3JlYWNoICh2YXIgaXRlbSBpbiBtZWlibykKICAgICAgICB7CiAgICAgICAgICAgIENvbnNvbGUuV3JpdGVMaW5lKGl0ZW0uQWdlKTsKICAgICAgICB9CiAgICB9Cn0=