static void toHex(int mun)
{
char[] arr = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
char[] ar = new char[8];
int pos = ar.length;
System.out.print("0x");
while(mun != 0)
{
int temp = mun & 15 ;
ar[--pos] = arr[temp];
mun = mun >>> 4;
}
for(int y = pos ; y < ar.length-1 ; y++)
{
System.out.print(ar[y]);
}
}
这是那错了?语法没错误,结果错了
|
|