1
2
3
4
5
6
7
8
9
10
11
12
13
14
public static String getNumberToString(int number, String[] strArr) { 
        
        String returnValue = "";
        
        int length = strArr.length;
        while (number >= length) {
            int val = number / length - 1;
            int index = number % length;
          returnValue = strArr[index] + returnValue;
            number = val;
        }
      returnValue = strArr[number] + returnValue;
        return returnValue;
    }
 
cs

 

strArr 이 가,나,다 일때

 

입력값  출력값

1          가

2          나

3          다

4          가가

5          가나

6          가다

7          나가

.

.

.

           가가가

+ Recent posts