Bu yerda C++ dasturlari top-down va bottom-up dinamik dasturlash yordamida Fibonacci ketma-ketligining o'ninchi sonini hisoblash uchun berilgan: Top-down approach: #include <iostream> #include <unordered_map> using namespace std; unordered_map<int, int> memo; int fib_top_down(int n) { if (n == 0) return 0; if (n == 1) return 1; if (memo.countn)) return memo[n]; int result = fib_top_down - 1) + fib_top_down - 2); memo[n] = result; return result; } main (n) int { int; cout << "Enter the value of n "; >> bottom (n); cout << "The Fibonacci number is << "top_n "; >> bottom (n); cout << "The
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence