結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー nasanasa
提出日時 2017-12-01 09:41:05
言語 Ruby
(3.3.0)
結果
AC  
実行時間 82 ms / 5,000 ms
コード長 154 bytes
コンパイル時間 40 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-05-05 20:24:20
合計ジャッジ時間 786 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
12,160 KB
testcase_01 AC 81 ms
12,032 KB
testcase_02 AC 74 ms
12,288 KB
testcase_03 AC 73 ms
12,032 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:7: warning: mismatched indentations at 'elsif' with 'if' at 4
Main.rb:9: warning: mismatched indentations at 'elsif' with 'if' at 4
Main.rb:11: warning: mismatched indentations at 'else' with 'if' at 4
Syntax OK

ソースコード

diff #

n = gets.to_i

(1..n).each do |i|
  if(i%3 ==0 and i%5 == 0)  
puts "FizzBuzz"

elsif(i%3 == 0)
puts 'Fizz'
elsif(i%5 ==0)
puts 'Buzz'
else
puts i
end
end
0