进制转化

伪代码:
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实现:



二进制与八进制运行出问题,初步估计是Fib(10)运行后遗症,(自己后台强行关闭了pycharm...)

posted @ 2020-11-08 22:47  201230RookieHacker  阅读(83)  评论(0编辑  收藏  举报