编写一个程序,要求接收一个数字,程序会将这个数字以二进制方式打印,例如:数字10 , 以1010的方式打印出来

func binaryPrintIntNumber(num : Int) { var remainderArr:[Int] = [] //int数组,存储余数 var quotient:Int = num //表示商的变量,初始值是num while quotient > 0 { //商的值是0 let remainderNum = quotien
相关文章
相关标签/搜索