結果
| 問題 | No.188 HAPPY DAY | 
| コンテスト | |
| ユーザー |  sjgq5302 | 
| 提出日時 | 2017-07-09 17:07:10 | 
| 言語 | Ruby (3.4.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 91 ms / 1,000 ms | 
| コード長 | 610 bytes | 
| コンパイル時間 | 252 ms | 
| コンパイル使用メモリ | 7,680 KB | 
| 実行使用メモリ | 12,160 KB | 
| 最終ジャッジ日時 | 2024-12-31 01:51:14 | 
| 合計ジャッジ時間 | 600 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 1 | 
コンパイルメッセージ
Syntax OK
ソースコード
def judge(wmonth, wday, wcnt) #月と日の和が等しいか判定
    if wmonth == (wday / 10) + (wday % 10) then
        wcnt += 1
    end
    return wcnt
end
cnt = 0
for month in 1..12 do
    if month == 2 then  #2月
        for day in 1..28 do
            cnt = judge(month, day, cnt)
        end
    elsif month == 4 or month == 6 or month == 9 or month == 11 then  #4月,6月,9月,11月
        for day in 1..30 do
            cnt = judge(month, day, cnt)
        end
    else  #それ以外の月
        for day in 1..31 do
            cnt = judge(month, day, cnt)
        end
    end
end
puts cnt
            
            
            
        