标签: groovy
有什么比较好的方法呢?
def totalSightings=0; year.months.each{month-> month.weeks.each{week-> week.days.each{day-> total+=day.sightings; } } }
答案 0 :(得分:1)
year.months.weeks.days.sightings.flatten().sum()