結果

問題 No.188 HAPPY DAY
ユーザー _mi_lin__mi_lin_
提出日時 2019-01-17 18:10:39
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 42 ms / 1,000 ms
コード長 1,083 bytes
コンパイル時間 2,098 ms
コンパイル使用メモリ 102,416 KB
実行使用メモリ 20,412 KB
最終ジャッジ日時 2023-09-14 02:03:59
合計ジャッジ時間 2,521 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
20,412 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 No188HAPPYDAY
{
	class Program
	{
		static void Main(string[] args)
		{
			//HappyDayの定義
			int happyday31 = 0;
			int happyday30 = 0;
			int happyday28 = 0;

			//月の繰り返し
			for (int X=1; X <= 12; X++) {

				//31日までの月の場合
				if (X == 1 || X == 3 || X == 5 || X == 7 || X == 8 || X == 10 || X == 12)
				{
					for (int Y = 1; Y <= 31; Y++)
					{
						if (X == (Y / 10 + Y % 10))
						{
							happyday31++;
						}
					}
				}
				//30日までの月の場合
				else if (X == 4 || X == 6 || X == 9 || X == 11)
				{
					for (int Y = 1; Y <= 30; Y++)
					{
						if (X == (Y / 10 + Y % 10))
						{
							happyday30++;
						}
					}
				}
				//28日までの月の場合
				else if (X == 2)
				{
					for (int Y = 1; Y <= 28; Y++)
					{
						if (X == (Y / 10 + Y % 10))
						{
							happyday28++;
						}
					}
				}

			}
			//出力
			Console.WriteLine(happyday31 + happyday30 + happyday28);
		}
	}
}
0