func toBinary( num:Int)->String{
var num = num
var res = ""
repeat{
res = String(num%2) + res
num /= 2.0
}while num != 0 {
return res
}
}
func toBinary( num:Int)->String{
var num = num
var res = ""
repeat{
res = String(num%2) + res
num /= 2 //2需要是个Int类型
}while num != 0
// while后面没有大括号
return res
}