結果
問題 |
No.721 Die tertia (ディエ・テルツィア)
|
ユーザー |
|
提出日時 | 2019-02-13 10:16:26 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 213 ms / 2,000 ms |
コード長 | 535 bytes |
コンパイル時間 | 2,279 ms |
コンパイル使用メモリ | 74,804 KB |
実行使用メモリ | 55,232 KB |
最終ジャッジ日時 | 2024-09-13 09:52:59 |
合計ジャッジ時間 | 7,449 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
import java.text.SimpleDateFormat; import java.util.*; class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { String s = sc.next(); int y = Integer.parseInt(s.substring(0,4)); int m = Integer.parseInt(s.substring(5,7)) - 1; int d = Integer.parseInt(s.substring(8,10)); Calendar cl = Calendar.getInstance(); cl.set(y, m, d); cl.add(Calendar.DATE, 2); SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd"); System.out.println(sdf.format(cl.getTime())); } }