공부집
진법 변환 본문
//not : 변환시킬 진법
//val : 십진수 값
public static int notation(int not,int val){
int result = 0;
int []res;
res = new int[100];
int count = 0;
for(int i=0; val>0 ;i++){
res[i] = val%not;
val = val/not;
count++;
}
for(int i=count-1; 0<=i ;i--){
result *= 10;
result += res[i];
}
return result;
}
Comments