public static GetLength ( Box box ) : long | ||
box | Box | |
Результат | long |
public static long GetLength(Box box)
{
long length = 0;
foreach (var item in box.Seeds)
{
length += item.Length;
}
foreach (var item in box.Boxes)
{
length += GetLength(item);
}
return length;
}