From 27ae26e1d647f9480fb15d97c9c67cea27d3592c Mon Sep 17 00:00:00 2001 From: fy Date: Wed, 13 May 2026 18:20:23 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E4=BF=AE=E6=AD=A3=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=20fib=20=E8=BF=94=E5=9B=9E=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/GUIDE.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/GUIDE.md b/docs/GUIDE.md index e1510ef2..e7a9f0f9 100644 --- a/docs/GUIDE.md +++ b/docs/GUIDE.md @@ -558,10 +558,10 @@ fib(11) // 89 另一种写法: ``` func fib(n) { - if this.n == 0 { 0 } - else if this.n == 1 { 1 } - else if this.n == 2 { 1 } else { - fib(this.n-1) + fib(this.n-2) + if this.n == 0 { return 0 } + else if this.n == 1 { return 1 } + else if this.n == 2 { return 1 } else { + return fib(this.n-1) + fib(this.n-2) } } fib(10) // 55