0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

多言語FizzBuzzチャレンジ11日目:Ruby

Last updated at Posted at 2022-12-10

ここまでのまとめ

本日のお品書き

RailsじゃないよRubyだよ。大学の頃に必修の授業で触ったきりですね。

FizzBuzz

for n in 1...101 do
  if n%15==0
    puts 'FizzBuzz'
    # 人類はいい加減else if, elseif, elifを統一すべき。elsif...
  elsif n%3==0
    puts 'Fizz'
  elsif n%5==0
    puts 'Buzz'
  else
    puts n
  end
end

おまけ:実行環境

環境構築したくなかったので今回はオンラインのプレイグラウンドを使いました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?