The-Swift-2.0-Programming-Language-playground icon indicating copy to clipboard operation
The-Swift-2.0-Programming-Language-playground copied to clipboard

1.最大最小值的判定写错了

Open KongXiangX opened this issue 8 years ago • 0 comments

1.错误位置 if value < currentMin { currentMin = value } else { currentMax = value } } 2.个人的更改方法 //1.方法一

for index in 0..<array.count {
    let tem = array[index];
    print(tem)
    if tem < currentMin {
        currentMin = tem
    } else {
        if tem > currentMax {
            currentMax = tem
        }
    }
}

KongXiangX avatar Jan 14 '17 03:01 KongXiangX