回答編集履歴
1
ちょい修正
test
CHANGED
@@ -12,31 +12,33 @@
|
|
12
12
|
|
13
13
|
def [](num)
|
14
14
|
|
15
|
-
|
15
|
+
ans = case 0
|
16
16
|
|
17
|
-
|
17
|
+
when num % 15
|
18
18
|
|
19
|
-
@fizzbuzz.push(num)
|
19
|
+
@fizzbuzz.push(num)
|
20
20
|
|
21
|
-
|
21
|
+
"FizzBuzz"
|
22
22
|
|
23
|
-
|
23
|
+
when num % 3
|
24
24
|
|
25
|
-
@fizz.push(num)
|
25
|
+
@fizz.push(num)
|
26
26
|
|
27
|
-
|
27
|
+
"Fizz"
|
28
28
|
|
29
|
-
|
29
|
+
when num % 5
|
30
30
|
|
31
|
-
@buzz.push(num)
|
31
|
+
@buzz.push(num)
|
32
32
|
|
33
|
-
|
33
|
+
"Buzz"
|
34
34
|
|
35
|
-
|
35
|
+
else
|
36
36
|
|
37
|
-
@normal.push(num)
|
37
|
+
@normal.push(num)
|
38
38
|
|
39
|
+
"Normal"
|
40
|
+
|
39
|
-
end
|
41
|
+
end
|
40
42
|
|
41
43
|
puts "#{num} >> #{ans}"
|
42
44
|
|