結果

問題 No.188 HAPPY DAY
ユーザー k-a-rgbk-a-rgb
提出日時 2023-08-17 11:59:50
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 99 ms / 1,000 ms
コード長 635 bytes
コンパイル時間 3,526 ms
コンパイル使用メモリ 103,776 KB
実行使用メモリ 21,908 KB
最終ジャッジ日時 2023-08-17 11:59:54
合計ジャッジ時間 2,726 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
21,908 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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
{
    static void Main()
    {
		//2015/1/1 取得 変数a
		//2016/1/1 取得 変数b
		//
		// 日付と時刻を格納するための変数を宣言する
    DateTime dtBirth = DateTime.Parse("2015/01/01");
	DateTime dtBirthB = DateTime.Parse("2016/01/01");
	int a = 0;
	int b = 0;
	int sumA = 0;
	int cnt=0;
	
	
    // 8 日加算する
    	while(dtBirth < dtBirthB){
    		a = dtBirth.Day % 10;
    		b = dtBirth.Day /10;
			sumA = a + b;    		
    		if(dtBirth.Month == sumA){
    			cnt++;
    		}
    		dtBirth = dtBirth.AddDays(1);
    		
		
    	}
    	Console.WriteLine(cnt);
    }
}
0