回答編集履歴
2
修正
test
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
```ruby
|
2
2
|
|
3
|
-
n = gets.to_i
|
3
|
+
input_lines = gets.to_i
|
4
4
|
|
5
5
|
retreve_word = gets.chomp
|
6
6
|
|
7
|
-
if(n.times.count{
|
7
|
+
if(input_lines.times.count{
|
8
8
|
|
9
9
|
word = gets
|
10
10
|
|
1
修正
test
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
```ruby
|
2
2
|
|
3
3
|
n = gets.to_i
|
4
|
+
|
5
|
+
retreve_word = gets.chomp
|
4
6
|
|
5
7
|
if(n.times.count{
|
6
8
|
|
7
9
|
word = gets
|
8
10
|
|
9
|
-
next !puts(word) if word.include?(
|
11
|
+
next !puts(word) if word.include?(retreve_word)
|
10
12
|
|
11
13
|
}.zero?)
|
12
14
|
|
@@ -18,6 +20,4 @@
|
|
18
20
|
|
19
21
|
|
20
22
|
|
21
|
-
ところで、`include?`による判定ですと`abchogehogexx`みたいなのが**一致**と判定され
|
22
|
-
|
23
|
-
[`eql?`](https://docs.ruby-lang.org/ja/latest/method/String/i/eql=3f.html)の方が一致する単語ぽい感じがします。
|
23
|
+
ところで、`include?`による判定よりも[`eql?`](https://docs.ruby-lang.org/ja/latest/method/String/i/eql=3f.html)の方が一致する単語ぽい感じがします。
|