class Solution {
public int solution(int age) {
return 2022-age+1;
}
}
import java.time.*;
class Solution {
public int solution(int age) {
LocalDate today = LocalDate.now();
return today.getYear() - age + 1;
}
}
'IT > Coding Test' 카테고리의 다른 글
[BOJ] 1748번 : 수 이어 쓰기 1 (1) | 2024.09.27 |
---|---|
[BOJ] 1475번: 방 번호 (0) | 2024.09.24 |
[JAVA] 배열의 평균값 (0) | 2024.06.04 |
[JAVA] 두 수의 차 (0) | 2024.06.04 |