Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Token
- Java
- static
- 회고록
- 스파르타내일배움캠프TIL
- 스파르타내일배움캠프
- 변수의 다양성
- 성장기록
- 포맷은 최후의 보루
- 스레드
- KPT
- Github_token
- 감사기록
- 인스턴스
- #내일배움캠프
- JVM
- Git
- Diary 해우소
- 객체지향 언어
- 생성자
- 해우소
- #스파르타내일배움캠프
- 내일배움캠프
- GitHub
- 메서드
- #스파르타내일배움캠프TIL
- 클래스
- TiL_1st_0419
- diary
- Java의 이점
Archives
- Today
- Total
몬그로이
코드카타 본문
자연수 뒤집어 배열 만들기
|
public int[] solution(long n) {
long firstN = n;
int length = 0;
while (n > 0) {
n = n/10;
length++;
}
int[] answer = new int[length];
n = firstN;
for(int j = 0; j < answer.length; j++){
answer[j] = (int) (n%10);
n = n/10;
}
return answer;
}
|
cs |
문자열을 정수로 바꾸기
|
public int solution(String s) {
int answer = Integer.parseInt(s);
return answer;
}
|
cs |