Guest User

Untitled

a guest
Dec 13th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.30 KB | None | 0 0
  1. puts "Please type in the strings!"
  2.      
  3.   array = []
  4.   word = gets.chomp
  5.   while word != '' do
  6.     array.push word.downcase
  7.     word = gets.chomp
  8.   end
  9.  
  10.   sa = array.clone
  11.   sa.each_index do |i|
  12.     j = i
  13.       while j>0 && sa[j] < sa[j-1]
  14.         sa[j],sa[j-1] = sa[j-1], sa[j]
  15.     end
  16.   end
Add Comment
Please, Sign In to add comment