結果

問題 No.188 HAPPY DAY
ユーザー ryosuke0825ryosuke0825
提出日時 2018-04-08 09:55:43
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 589 bytes
コンパイル時間 3,215 ms
コンパイル使用メモリ 71,980 KB
実行使用メモリ 59,076 KB
最終ジャッジ日時 2023-09-08 18:22:13
合計ジャッジ時間 3,985 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Calendar;

public class No188 {

	public static void main(String[] args) {
		Calendar clnow = Calendar.getInstance();
		clnow.set(2015, 1, 1);

		Calendar clend = Calendar.getInstance();
		clend.set(2016, 1, 1);

		int count = 0;
		while (clnow.compareTo(clend) < 0) {
			String[] arr = String.valueOf(clnow.get(Calendar.DATE)).split("");

			int sumDay = 0;
			for (String s : arr) {
				sumDay += Integer.parseInt(s);
			}

			if (clnow.get(Calendar.MONTH) == sumDay) {
				count++;
			}

			clnow.add(Calendar.DAY_OF_MONTH, 1);
		}

		System.out.println(count);

	}

}
0