Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- puts "Please type in the strings!"
- array = []
- word = gets.chomp
- while word != '' do
- array.push word.downcase
- word = gets.chomp
- end
- sa = array.clone
- sa.each_index do |i|
- j = i
- while j>0 && sa[j] < sa[j-1]
- sa[j],sa[j-1] = sa[j-1], sa[j]
- end
- end
Add Comment
Please, Sign In to add comment