RUBYの宿題教えてください。 at TECH
[2ch|▼Menu]
485:デフォルトの名無しさん
07/02/04 22:30:44
>>181
class Array
def srt
case size
when 0,1
self
else
f,*t = self
t.select{|v| v <= f}.srt + [f] + t.select{|v| v > f}.srt
end
end
end

nums = (0..9).map{rand(100)}
p nums
p nums.srt


次ページ
続きを表示
1を表示
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

4657日前に更新/173 KB
担当:undef