From 4cd54f798f621b5ad6f2c97c471ffa18bf2dcff2 Mon Sep 17 00:00:00 2001 From: pqz4hix59 <1551744337@qq.com> Date: Thu, 10 Feb 2022 12:57:17 +0800 Subject: [PATCH] ADD file via upload --- 斐波那契数列.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 斐波那契数列.cpp diff --git a/斐波那契数列.cpp b/斐波那契数列.cpp new file mode 100644 index 0000000..4208997 --- /dev/null +++ b/斐波那契数列.cpp @@ -0,0 +1,22 @@ +#include +typedef unsigned long long ull; +ull num[81]; +void op() +{ + num[1]=1; + for(int i=2;i<=80;i++) + num[i]=num[i-1]+num[i-2]; +} +ull out(int x) +{ + return num[x]; +} +int main() +{ + int n; + scanf("%d",&n); + op(); + for(int i=1;i<=n;i++) + printf("%llu ",out(i)); + return 0; +}