List<Tuple<string, string, int>> roads
roads.Add(new Tuple<string, string, int>)("first", "second", 1);
roads.Add(new Tuple<string, string, int>)("first", "second", 2);
roads.Add(new Tuple<string, string, int>)("first", "second", -5);
roads.Add(new Tuple<string, string, int>)("first", "second", 3);
需要显示 item3 < 0 的元组计数
我的变体(不正确):
var r roads.Select(t => t.Item3 < 0).Count;