結果

問題 No.721 Die tertia (ディエ・テルツィア)
ユーザー yuichiyoshi
提出日時 2020-07-15 15:30:12
言語 Java
(openjdk 23)
結果
AC  
実行時間 213 ms / 2,000 ms
コード長 816 bytes
コンパイル時間 2,065 ms
コンパイル使用メモリ 74,568 KB
実行使用メモリ 55,136 KB
最終ジャッジ日時 2024-11-21 22:30:22
合計ジャッジ時間 7,867 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Main {
	public static void main(String[] args) throws Exception{
		Scanner sc = new Scanner(System.in);
        int y;
        int m;
        int d;
        int div;
        Calendar cal = Calendar.getInstance();
        try {
		String s = sc.next();
        SimpleDateFormat sdFormat = new SimpleDateFormat("yyyy/MM/dd");
        Date date = sdFormat.parse(s);
        cal.setTime(date);
        
        cal.add(Calendar.DATE, 2);
        y = cal.get(Calendar.YEAR);
        m = cal.get(Calendar.MONTH) + 1;
        d = cal.get(Calendar.DATE);
        date = cal.getTime();
        System.out.println(sdFormat.format(date));
        
        }catch(Exception e){
         
        }
    }
}
0