struct people {
var name: String
var age: Int
var gender: String
}
var people1 = people(name: "zhuang", age: 18, gender: "nan")
people1.name = "李明"
people1.age = 20
people1.gender = "男"
print(people1)
var people2 = people(name: "zhuang", age: 18, gender: "nan")
people2.name = "王凯"
people2.age = 23
print(people2)
struct value {
var weith: Double = 10
var heigth: Double = 10
func show() {
print("heigth = ?\(weith), weith = \(heigth)")
}
func getHeigth() -> Double {
return weith*heigth
}
}
var value1: value = value()
value1.weith = 15
value1.heigth = 20
value1.show()
value1.getHeigth()