aboutsummaryrefslogtreecommitdiff
path: root/entries/komodoooo
diff options
context:
space:
mode:
Diffstat (limited to 'entries/komodoooo')
-rw-r--r--entries/komodoooo/fib.cr9
-rw-r--r--entries/komodoooo/fib.rb9
2 files changed, 18 insertions, 0 deletions
diff --git a/entries/komodoooo/fib.cr b/entries/komodoooo/fib.cr
new file mode 100644
index 0000000..f15ca3b
--- /dev/null
+++ b/entries/komodoooo/fib.cr
@@ -0,0 +1,9 @@
+def fibonacci(n)
+ a,b=0,1
+ while a < n
+ puts "#{a} "
+ a,b=b,a+b
+ end
+end
+print "Number: "
+fibonacci(gets.not_nil!.to_i)
diff --git a/entries/komodoooo/fib.rb b/entries/komodoooo/fib.rb
new file mode 100644
index 0000000..ce25eeb
--- /dev/null
+++ b/entries/komodoooo/fib.rb
@@ -0,0 +1,9 @@
+def fibonacci(n)
+ a,b=0,1
+ while a<n
+ puts"#{a} "
+ a,b=b,a+b
+ end
+end
+print"Number: "
+fibonacci(gets.chomp.to_i)