結果
問題 | No.188 HAPPY DAY |
ユーザー |
![]() |
提出日時 | 2018-06-27 08:52:35 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 90 ms / 1,000 ms |
コード長 | 938 bytes |
コンパイル時間 | 179 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,160 KB |
最終ジャッジ日時 | 2024-06-30 23:07:30 |
合計ジャッジ時間 | 758 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 |
コンパイルメッセージ
Syntax OK
ソースコード
#!/bin/rubyhappy_day = 01.upto(12) do |month|if 2 === month1.upto(28) do |day|if day < 10if month === dayhappy_day += 1endelsesum = 0day.to_s.split('').each { |str| sum += str.to_i}if month === sumhappy_day += 1endendendelsif [4, 6, 9, 11].include?(month)1.upto(30) do |day|if day < 10if month === dayhappy_day += 1endelsesum = 0day.to_s.split('').each { |str| sum += str.to_i}if month === sumhappy_day += 1endendendelse1.upto(31) do |day|if day < 10if month === dayhappy_day += 1endelsesum = 0day.to_s.split('').each { |str| sum += str.to_i}if month === sumhappy_day += 1endendendendendputs happy_day