teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

修正

2017/02/18 20:22

投稿

退会済みユーザー
answer CHANGED
@@ -2,6 +2,6 @@
2
2
  ary0 = ["とんかつ定食", "ラーメン", "チャーハン", "サラダ"]
3
3
  ary1 = [1, 3, 0, 2]
4
4
 
5
- ary0.each_with_index{|s, i| print s + ary1[i].to_s + "個、"}
5
+ ary0.each_with_index{|s, i| print s + ary1[i].to_s + "個#{i != ary1.length - 1? "、" : "。"}"}
6
6
  ```
7
7
  今更ですが、私も考えてみました。