首页 > 其他 > 详细

进制转化

时间:2020-11-08 22:28:46      阅读:24      评论:0      收藏:0      [点我收藏+]

伪代码:

Write "Enter the new base"
Read newBase
Write "Enter the number to be converted"
Read decimalNumber
Set quotient to 1
WHILE (quotient is not zero)
Set quotient to decimalNumber DIV newBase
Set remainder to decimalNumber REM newBase
Make the remainder the next digit to the left in the answer
Set decimalNumber to quotient
Write "The answer is "
Write answer

 

PYTHON实现

十六进制

技术分享图片

八进制

技术分享图片

二进制

技术分享图片

进制转化

原文:https://www.cnblogs.com/hahahahahahahaij/p/13945721.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!