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 나가
.
.
.
가가가
'공부 > Java' 카테고리의 다른 글
maven 중복 의존성 해결 (The package javax.xml.namespace is accessible from more than one module: <unnamed>, java.xml) (1) | 2024.02.28 |
---|---|
maven 설치, 환경변수 추가('maven'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는 배치 파일이 아닙니다. 해결) (1) | 2024.02.28 |
이클립스 UTF-8 해도 한글 깨질때 (0) | 2022.07.03 |
톰캣 설치 및 이클립스에 적용 (0) | 2022.07.03 |
JDK 설치, 환경 변수 설정, maven, gradle 다운로드 (0) | 2022.06.30 |