开发者

print hexadecimal representation of an int

开发者 https://www.devze.com 2023-01-24 23:53 出处:网络
i am looking for a pseu开发者_JAVA百科docode that prints the hexadecimal represenation of an integer as string.

i am looking for a pseu开发者_JAVA百科docode that prints the hexadecimal represenation of an integer as string.

thanks!


  • Take the remainder of the integer modulo 16
  • Convert the remainder to a hex digit
  • Place the hex digit into the left-most position in the output string
  • Divide the integer by 16
  • Repeat the above until the value is zero
0

精彩评论

暂无评论...
验证码 换一张
取 消