Guest User

Untitled

a guest
Oct 23rd, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. def find_nb(m)
  2. i = 1
  3. xan = 1
  4. while m != 0 do
  5. m -= xan
  6. i += 1
  7. if m < 0 then
  8. return -1
  9. else
  10. xan =i**3
  11. end
  12. end
  13. return i-1
  14. end
  15.  
  16. #puts find_nb(ARGV[0].to_i)
Add Comment
Please, Sign In to add comment