We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec061d9 commit f82d272Copy full SHA for f82d272
Fibonacci Numbers using boost library
@@ -0,0 +1,32 @@
1
+
2
+#include <bits/stdc++.h>
3
+#include <boost/multiprecision/cpp_int.hpp>
4
+using big_int = boost::multiprecision::cpp_int;
5
+using namespace std;
6
7
+int fibo(int n)
8
+{
9
10
+ big_int a = 0;
11
+ big_int b = 1;
12
+ cout <<a<<" "<<b<<" ";
13
14
+ for (int i = 2; i < n; i++)
15
+ {
16
+ big_int c = a + b;
17
+ cout <<c <<" ";
18
+ a = b;
19
+ b = c;
20
+ }
21
+}
22
23
24
+int main()
25
26
+ int n;
27
+ cin>>n;
28
29
+ fibo(n);
30
31
+ return 0;
32
0 commit comments