@ -41,7 +41,7 @@ struct TimesTable {
|
||||
}
|
||||
let threeTimesTable = TimesTable(multiplier: 3)
|
||||
print("six times three is \(threeTimesTable[6])")
|
||||
// 打印 "six times three is 18"
|
||||
// 打印“six times three is 18”
|
||||
```
|
||||
|
||||
在上例中,创建了一个 `TimesTable` 实例,用来表示整数 `3` 的乘法表。数值 `3` 被传递给结构体的构造函数,作为实例成员 `multiplier` 的值。
|
||||
|
||||
Reference in New Issue
Block a user