結果

問題 No.188 HAPPY DAY
ユーザー outoforder
提出日時 2017-07-22 00:51:19
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 27 ms / 1,000 ms
コード長 723 bytes
コンパイル時間 859 ms
コンパイル使用メモリ 116,668 KB
実行使用メモリ 25,364 KB
最終ジャッジ日時 2024-12-31 01:52:18
合計ジャッジ時間 1,366 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace No188
{
    public class Program
    {
        public static void Main(string[] args)
        {
            DateTime n = new DateTime(2015, 1, 1);
            DateTime end = new DateTime(2015, 12, 31);
            int count = 0;

            while(n <= end )
            {
                var day = n.Day.ToString("00").ToArray().Select(s => int.Parse(s.ToString())).ToList();

                if (n.Month == day[0] + day[1])
                {
                    count++;
                }
                n = n.AddDays(1);
            }

            Console.WriteLine(count);
        }
    }
}
0