repo.or.cz
/
ruby-svn.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
* transcode.c (econv_init): accept Encoding object as source_encoding
[ruby-svn.git]
/
sample
/
fib.rb
blob
cde4fba0825cff0ddf4cb9e940b042e2cdebe50b
1
# calculate Fibonacci(20)
2
# for benchmark
3
def fib(n)
4
if n<2
5
n
6
else
7
fib(n-2)+fib(n-1)
8
end
9
end
10
print(fib(20), "\n");