Last active
December 16, 2018 21:03
-
-
Save darya-makarenko/122cf3b3c16c9296ce1269d3ad8e0637 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts "Enter the elements of array: (f.e. 1 2 3 4)" | |
arr = gets.chomp.split.map(&:to_i) | |
#extracting the first element in array | |
#pushing it to the last place | |
arr.push(arr.shift) | |
puts "The result array: #{arr.join(" ")}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🥇