in C# 7
var coords = new[] { ( 50, 350 ), ( 50, 650 ), ( 450, 650 )};
对于命名版本,请执行以下操作:(谢谢entiat https://stackoverflow.com/users/2375458/entiat)
var coords2 = new(int X, int Y) [] { (50, 350), (50, 650), (450, 650) };
or
(int X, int Y) [] coords3 = new [] { (50, 350), (50, 650), (450, 650) };
or
(int X, int Y) [] coords4 = { (50, 350), (50, 650), (450, 650) };
所以我们可以使用 X, Y 代替 Item1, Item2
coords4.Select(t => $"Area = {t.X * t.Y}");