wrichaard

sort simples uri judge

May 14th, 2021
1,085
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. linha = gets.strip.split(' ')
  2.  
  3. valor1, valor2, valor3 = linha
  4.  
  5. valor1 = valor1.to_i
  6. valor2 = valor2.to_i
  7. valor3 = valor3.to_i
  8.  
  9. a = valor1
  10. b = valor2
  11. c = valor3
  12.  
  13. if a < b
  14.     temp = a
  15.     a = b
  16.     b = temp
  17. end
  18.  
  19. if b < c
  20.     temp = b
  21.     b = c
  22.     c = temp
  23. end
  24.  
  25. if a < c
  26.     temp = a
  27.     a = c
  28.     c = temp
  29. end
  30.  
  31. puts "#{c}"
  32. puts "#{b}"
  33. puts "#{a}"
  34. puts ""
  35. puts "#{valor1}"
  36. puts "#{valor2}"
  37. puts "#{valor3}"
RAW Paste Data