diff --git a/script.js b/script.js index e69de29..3f33271 100644 --- a/script.js +++ b/script.js @@ -0,0 +1,19 @@ + + +const monate = 10; + +function fibonacci(n) { + let folge = [1, 1]; + for (let i = 2; i < n; i++) { + folge[i] = folge[i - 1] + folge[i - 2]; + } + return folge; +} + +const hasenPaare = fibonacci(monate); + + +console.log("Hasen-Paare pro Monat:"); +hasenPaare.forEach((paare, index) => { + console.log(`Monat ${index + 1}: ${paare} Paar(e)`); +});