How to convert an arbitrary large integer from base 10 to base 16?

后端 未结 7 1917
旧时难觅i
旧时难觅i 2021-02-04 21:39

The program requires an input of an arbitrary large unsigned integer which is expressed as one string in base 10. The outputs is another string that expresses the integer in bas

7条回答
  •  深忆病人
    2021-02-04 22:14

    Python:

    >>> from string import upper
    >>> input = "1234567890987654321234567890987654321234567890987654321"
    >>> output = upper(hex(int(input)))[2:-1]
    >>> print output
    CE3B5A137DD015278E09864703E4FF9952FF6B62C1CB1
    

提交回复
热议问题