Two positive numbers

  • (2 Pages)
  • +
  • 1
  • 2

15 Replies - 3576 Views - Last Post: 22 February 2012 - 07:49 PM Rate Topic: -----

#16 Karel-Lodewijk  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 449
  • View blog
  • Posts: 849
  • Joined: 17-March 11

Re: Two positive numbers

Posted 22 February 2012 - 07:49 PM

View Postabhaydchamp, on 22 February 2012 - 11:16 AM, said:

Similar to answer by Karel-Lodewijk with samall difference:

num1, num2 = gets.chomp.split(",").collect{|x| x.to_i}


The difference is even smaller than you think, map and collect are aliases, it's the very same function.

This post has been edited by Karel-Lodewijk: 22 February 2012 - 07:52 PM

Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2