結果

問題 No.188 HAPPY DAY
ユーザー oldlevinoldlevin
提出日時 2020-02-20 09:41:05
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 22 ms / 1,000 ms
コード長 672 bytes
コンパイル時間 900 ms
コンパイル使用メモリ 103,296 KB
実行使用メモリ 17,280 KB
最終ジャッジ日時 2024-04-17 06:18:29
合計ジャッジ時間 1,233 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
17,280 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.Linq;
using System.Collections.Generic;
using static System.Console;

public class hello{
    public static void Main(){

        //No.188 HAPPY DAY  X月Y日についてYの数字和がXと等しいとき
        int[] d = {0,31,28,31,30,31,30,31,31,30,31,30,31};
        var sum =0;
        
        for(int m=1;m<d.Length;m++  ){
            for(int j=1;j<=d[m];j++){

                var h = (int)(j/10) ;
                var t = j-h*10;
        
                if(m == (h+t)) {
                    sum++;
                    //WriteLine(m + " " + h + " " + t);
                }    
            }
        }
        WriteLine(sum);
    }
}
0