재 현
100일 후의 날짜 본문
728x90
public static void main(String[] args) {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE,100);
StringBuilder sb = new StringBuilder();
int yyyy = cal.get(Calendar.YEAR);
int month = cal.get(Calendar.MONTH);
int date = cal.get(Calendar.DATE);
String s = sb.append(yyyy).append("년").append(month).append("월").append(date).append("일").toString();
System.out.print(s);
}
728x90
'Coding test' 카테고리의 다른 글
숫자의 표현 (0) | 2021.06.29 |
---|---|
JadenCase 문자열 만들기 (0) | 2021.06.29 |
같은 숫자는 싫어 (0) | 2021.06.24 |
제일 작은 수 제거하기 (0) | 2021.06.24 |
시저암호 (0) | 2021.06.23 |