結果

問題 No.188 HAPPY DAY
コンテスト
ユーザー aaa aa
提出日時 2025-11-11 14:32:38
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 965 bytes
コンパイル時間 930 ms
コンパイル使用メモリ 107,980 KB
実行使用メモリ 24,360 KB
最終ジャッジ日時 2025-11-11 14:32:40
合計ジャッジ時間 1,769 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
public class Program
{
    public static void Main()
    {
        int happyDay = 0; //カウント

        for (int i = 0; i < 365; i++)
        {
            DateTime addDay = new DateTime(2015, 1, 1).AddDays(i);

            if (addDay.Month == addDay.Day) //月と日が同じ
            {
                happyDay++;
                //Console.WriteLine(addDay.ToString());

                continue;
            }
            else if (addDay.Day >= 10) //day10以上
            {
                //十の位
                int ten = addDay.Day / 10;
                //一の位
                int one = addDay.Day % (ten * 10);

                int num = ten + one;
                if (addDay.Month == num)
                {
                    happyDay++;
                    //Console.WriteLine(addDay.ToString());

                    continue;
                }
            }
        }
        Console.WriteLine("{0}", happyDay);
    }
}
0