数组的enumerate(swift)
by 伍雪颖
let
arr:
Array
= [
1
,
2
,216)">3
,216)">4
,216)">5
]
var result = 0
for (idx,num) in enumerate (arr) {
result += num
}
var result = 0
for (idx,num) in enumerate (arr) {
result += num
}
println
(result)