struct Student
{
var name = "unknow"
var age = 0
var score = 0.0
var isPass = false
static let schollName = "雷迪森"
init(name:String,age:Int,score:Double) {
self.name = name
self.age = age
self.score = score
if self.score < 60 {
self.isPass = false
}else{
self.isPass = true
}
}
func fetch() -> String
{
return self.name
}
}
var a = Student(name: "嘻嘻嘻", age: 20, score: 90)
print(a)
print(Student.schollName)
网友评论