题解 | #二进制转换#
二进制转换
https://www.nowcoder.com/practice/7b74386695cc48349af37196f45e62a8
function convertToBinary(num) {
let num2 = num.toString(2);
while(num2.length<8) {
num2 = '0' + num2;
}
return num2;
}
二进制转换
https://www.nowcoder.com/practice/7b74386695cc48349af37196f45e62a8
function convertToBinary(num) {
let num2 = num.toString(2);
while(num2.length<8) {
num2 = '0' + num2;
}
return num2;
}
相关推荐