Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Что выведет данный код на Ruby ?
- def f(n)
- if n<0
- (1 - 2*( (1-n)%2 )*f(n)
- elsif n==0 || n==1
- n
- else
- f(n-1)+f(n-2)
- end
- end
- def l(n)
- f(n-1)+f(n+1)
- end
- puts l(-256)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement