来 看谁的代码短 C. Hexadecimal's Numbers time limit per test 1 second memory limit per test 64 megabytes input standard input output standard output One beautiful July morning
文章目录 一、题目二、题解 一、题目 Given an integer num, return a string representing its hexadecimal representation. For negative integers, two’s complement method is used. All the letters in the answer s
题目地址:https://leetcode.com/problems/convert-a-number-to-hexadecimal/ Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complement method is used. Note: A
LeetCode405 Convert a Number to Hexadecimal 想到了一种新的方法,比以前的方法的效率要稍微好一些 public class solution {public String toHex(int num) {StringBuffer sb = new StringBuffer();//使用逻辑右移的方式进行处理char[] arr = {'0','1'