public class Solution {
public String toHex(int num) {
char[] mymap={'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
String s="";
if(num==0)
return "0";
while(num!=0)
{
s=mymap[num&15]+s;
num>>>=4;
}
return s;
}
}
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交