This commit is contained in:
krahets
2024-03-21 04:22:07 +08:00
parent 35a07170c0
commit cfdb743939
52 changed files with 292 additions and 290 deletions

View File

@@ -745,6 +745,11 @@ In most programming languages, we can traverse an array either by using indices
for num in nums {
count += num
}
// 同时遍历数据索引和元素
for (i, num) in nums.enumerated() {
count += nums[i]
count += num
}
}
```