已知总数量为27,每三列为一行,求总行数代码如下:
/// 总数量
let count_row = 27
/// 3 列 一行
/// 求总行数
let rowC = Int(floor(Double(count_row - 1)/3) + 1)
print("==== \(rowC)")
let rowCount = Int(ceil(Double(count_row) / 3))
print("==== \(rowCount)")
网友评论