結果

問題 No.188 HAPPY DAY
ユーザー yui-taryui-tar
提出日時 2021-03-24 20:02:02
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 48 ms / 1,000 ms
コード長 994 bytes
コンパイル時間 2,120 ms
コンパイル使用メモリ 103,496 KB
実行使用メモリ 22,492 KB
最終ジャッジ日時 2023-08-17 22:32:41
合計ジャッジ時間 2,594 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
22,492 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
class Sample
{
    public static void Main()
    {
        int count = 0;
        int num;
        for(int i = 1; i <= 12; i++)
        {
            switch(i){
                case (2):
                    num = 28;
                    break;
                case (4):
                    num = 30;
                    break;
                case (6):
                    num = 30;
                    break;
                case (9):
                    num = 30;
                    break;
                case (11):
                    num = 30;
                    break;
                default:
                    num = 31;
                    break;
            }
            for(int j = 1; j <= num; j++)
            {
                int month = j / 10;
                int day = j % 10;
                if (i == month + day)
                {
                    count++;
                }
            }
            
        }
        Console.WriteLine(count);
    }
}
0