let score1 = (Chinese:90, math:95)
let score2 = (Chinese:90, math:100)
let score3 = (Chinese:100, math:90)
score1 < score2
score3 < score2
func <(t1:(Int,Int), t2:(Int,Int)) -> Bool {
if t1.1 != t2.1 { // 优先比较数学成绩
return t1.1 < t2.1
}
return t1.0 < t2.0
}
网友评论