* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package 演算法;
/**
*
* @author howard
*/
public class TestM1 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int v = 48141;
int tmp = v;
String[] ohx = new String[]{"0","1","2","3","4","5","6","7","8","9",
"A","B","C","D","E","F"};
int[] numbers = new int[100];
int i = 0;
while (tmp > 15){
int c = tmp % 16;
numbers[i] = c;
tmp /= 16;
i++;
}
numbers[i] = tmp;
for (int index = i;i>=0;i--){
System.out.print(ohx[numbers[i]]);
}
}
}
沒有留言:
張貼留言