编辑代码

func bianli() -> [Int] {
    var ret : [Int] = []
    for a in 1...6{
        for b in 1...6{
            if a == b{
                continue
            }
            for c in 1...6{
                if a == c || b == c {
                    continue
                }
                ret.append(a*100+b*10+c)
            }
        }
    }
    return ret
}
var str = ""
for (index,i) in bianli().enumerated() {
    str += String(i) + " "
    if (index + 1) % 15 == 0{
        print(str)
        str = ""
    }
}
print(str)