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