Advertisement
Guest User

Untitled

a guest
Dec 18th, 2015
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.41 KB | None | 0 0
  1. nums = []
  2. dubs = []
  3.  
  4. puts "I NEED SOME NUMBERS!"
  5. print "1st number: "
  6. num1 = $stdin.gets.chomp
  7. print "\n2nd number: "
  8. num2 = $stdin.gets.chomp
  9. print "\n3rd number: "
  10. num3 = $stdin.gets.chomp
  11.  
  12. nums.push(num1, num2, num3)
  13. nums.each {|num| puts "You chose #{num}" }
  14.  
  15. puts "Let\'s double those!"
  16.  
  17. nums.each do |dub|
  18.     num * 2
  19.     dubs.push(dub)
  20. end
  21.  
  22. dubs.each {|dub| puts "The new numbers are #{dubs}" }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement