diff --git a/README-zh.md b/README-zh.md index 007a24f..d75dfbd 100644 --- a/README-zh.md +++ b/README-zh.md @@ -370,15 +370,7 @@ public long Fibonacci(int n) ```csharp public long Fibonacci(int n) { - if (n == 0) - { - return 0; - } - - if (n == 1) - { - return 1; - } + if (n == 0 || n == 1) return n; if (n > 50) { diff --git a/README.md b/README.md index 0917da9..5fdce4b 100644 --- a/README.md +++ b/README.md @@ -369,15 +369,7 @@ public long Fibonacci(int n) ```csharp public long Fibonacci(int n) { - if (n == 0) - { - return 0; - } - - if (n == 1) - { - return 1; - } + if (n == 0 || n == 1) return n; if (n > 50) {