再请教一下,如果让2进制和16进制来回转换呢? by shaoyangding #121
Open
Labels
Comments
先想想,你怎样表示二进制数呢。然后就知道了。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
import Numeric (showHex, showIntAtBase)
import Data.Char (intToDigit)
putStrLn $ showHex 12 "" -- prints "c"
putStrLn $ showIntAtBase 16 intToDigit 556 "" -- prints "22c"
这样可以把10进制的转换了,有什么方法可以转换2进制到16进制
或者16进制转换成2进制呢?
The text was updated successfully, but these errors were encountered: