作者在 2020-06-15 10:28:46 发布以下内容
CLEAR
n10=ASC('D')
c02=''
DO WHILE n10 > 0
n = MOD(n10, 2)
n10 = INT(n10 / 2)
c02=STR(n, 1) + c02
ENDDO
MESSAGEBOX(c02)
CLEAR
n10=ASC('D')
c02=''
DO WHILE n10 > 0
n = MOD(n10, 2)
n10 = INT(n10 / 2)
c02=STR(n, 1) + c02
ENDDO
MESSAGEBOX(c02)
* 二进制转换为十进制
n10 = 0
FOR lnI = 1 TO LEN(c02)
n10 = n10 + VAL(SUBSTR(c02, lnI, 1)) * 2 ^ (LEN(c02) - lnI)
ENDFOR
MESSAGEBOX(CHR(n10))