我有 3 个收藏列表,如下所示。
public static List<Thing> English = new List<Thing>
{
new Thing {ID = 1, Stuff = "one"},
new Thing {ID = 2, Stuff = "two"},
new Thing {ID = 3, Stuff = "three"}
};
public static List<Thing> Spanish = new List<Thing>
{
new Thing {ID = 1, Stuff = "uno"},
new Thing {ID = 2, Stuff = "dos"},
new Thing {ID = 3, Stuff = "tres"},
new Thing {ID = 4, Stuff = "cuatro"}
};
public static List<Thing> German = new List<Thing>
{
new Thing {ID = 1, Stuff = "eins"},
new Thing {ID = 2, Stuff = "zwei"},
new Thing {ID = 3, Stuff = "drei"}
};
在运行时,列表的长度可能会有所不同。例如,德语可能有 5 个值,英语有 2 个,西班牙语有 1 个。
我需要找到哪个列表具有最大值,并且需要以以下格式获取输出。
Id English German Spanish
1 one eins uno
2 two zwei dos
3 three drei tres
4 cuatro
你能帮我解决这个问题吗?