From 406acd42eeb772615bc3b4fe8a1cefabf13b786c Mon Sep 17 00:00:00 2001 From: pxecwsohz <2727710708@qq.com> Date: Sun, 13 Feb 2022 19:47:37 +0800 Subject: [PATCH] =?UTF-8?q?Update=20=E6=B1=82=E6=96=90=E6=B3=A2=E9=82=A3?= =?UTF-8?q?=E5=A5=91=E6=95=B0=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 求斐波那契数列 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/求斐波那契数列 b/求斐波那契数列 index e69de29..e57c003 100644 --- a/求斐波那契数列 +++ b/求斐波那契数列 @@ -0,0 +1,19 @@ +#include +int Fibon1(int n) +{ + if(n == 1||n == 2) + { + return 1; + } + else{ + return Fibon1(n-1) + Fibon1(n-2); + } +} +int main() +{ + int n,s; + scanf("%d",&n); + s = Fibon1(n); + printf("%d",s) + return 0; +} \ No newline at end of file