Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Fibonacci
//Title of this code //g++ 4.8.2 #include <iostream> // 1. 2. 3. 4. 5. 6. 7. 8. 9. // 0, 1, 1, 2, 3, 5, 8, 13, 21 unsigned fib(unsigned n) { if (n == 0) return 0; unsigned a = 0, b = 0, c = 1; for (unsigned i = 1; i < n; ++i) { a = b; b = c; c = a + b; } return b; } int main() { std::cout << fib(8); }
run
|
edit
|
history
|
help
0
DP on Trees: Type B (In/out Dp)
Luces led con relé
OTHER - Two robots
Wipro Problem 2: determine count
Dead_Lock
Tejas choudhari
csv parser
Heap sort baaaad
XD
Expected types