From db59a9cd6928f4e217e943080db9edbae0c3c548 Mon Sep 17 00:00:00 2001 From: "yuichi.imori" Date: Fri, 10 May 2024 11:49:37 +0900 Subject: [PATCH 1/2] =?UTF-8?q?FizzBuzz=E5=95=8F=E9=A1=8C=E3=81=AE?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 01.fizzbuzz/fizzbuzz.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 01.fizzbuzz/fizzbuzz.rb diff --git a/01.fizzbuzz/fizzbuzz.rb b/01.fizzbuzz/fizzbuzz.rb new file mode 100644 index 0000000000..0f40f15b6f --- /dev/null +++ b/01.fizzbuzz/fizzbuzz.rb @@ -0,0 +1,11 @@ +(1..20).each do |num| + if num % 3 == 0 && num % 5 == 0 + puts "FizzBuzz" + elsif num % 3 == 0 + puts "Fizz" + elsif num % 5 == 0 + puts "Buzz" + else + puts num + end +end \ No newline at end of file From 57deb6f920acc0b20cd781f4bf98fa39b7d50730 Mon Sep 17 00:00:00 2001 From: 1mori Date: Fri, 10 May 2024 12:05:30 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BD=99=E8=A8=88=E3=81=AA=E7=A9=BA?= =?UTF-8?q?=E7=99=BD=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 01.fizzbuzz/fizzbuzz.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/01.fizzbuzz/fizzbuzz.rb b/01.fizzbuzz/fizzbuzz.rb index 0f40f15b6f..3684fa9e9b 100644 --- a/01.fizzbuzz/fizzbuzz.rb +++ b/01.fizzbuzz/fizzbuzz.rb @@ -8,4 +8,4 @@ else puts num end -end \ No newline at end of file +end