結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー takumi-onisi
提出日時 2021-04-05 17:43:03
言語 Ruby
(3.4.1)
結果
AC  
実行時間 82 ms / 5,000 ms
コード長 290 bytes
コンパイル時間 220 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-12-31 10:31:01
合計ジャッジ時間 1,256 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

(1..gets.to_i).each do |num|
  if (num % 3 == 0) and not (num % 5 == 0) then
    puts "Fizz"
    next
  end
  
  if not (num % 3 == 0) and (num % 5 == 0) then
    puts "Buzz"
    next
  end
  
  if  (num % 3 == 0) and (num % 5 == 0) then
    puts "FizzBuzz"
    next
  end
  
  puts num
end
0