結果
| 問題 |
No.9002 FizzBuzz(テスト用)
|
| ユーザー |
|
| 提出日時 | 2017-06-16 23:52:34 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 87 ms / 5,000 ms |
| コード長 | 286 bytes |
| コンパイル時間 | 127 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,416 KB |
| 最終ジャッジ日時 | 2024-10-01 06:57:26 |
| 合計ジャッジ時間 | 1,133 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
コンパイルメッセージ
Main.rb:4: warning: mismatched indentations at 'elsif' with 'if' at 2 Main.rb:6: warning: mismatched indentations at 'elsif' with 'if' at 2 Main.rb:8: warning: mismatched indentations at 'else' with 'if' at 2 Main.rb:10: warning: mismatched indentations at 'end' with 'else' at 8 Syntax OK
ソースコード
def FizzBuzz(i)
if i % 3 === 0 && i % 5 === 0
puts "FizzBuzz"
elsif i % 5 === 0
puts "Buzz"
elsif i % 3 === 0
puts "Fizz"
else
puts i
end
end
N = gets.to_i
i = 1
while i <= N do
FizzBuzz(i)
i += 1
end