Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<math.h>
- using namespace std;
- int main() {
- long double tab[10000];
- int n;
- cout << "Ktora liczbe fibonacciego wyznaczyc:" << endl;
- cin >> n;
- tab[0] = 1;
- tab[1] = 1;
- for (int i = 2; i <= n; i++) {
- tab[i] = tab[i - 1] + tab[i - 2];
- }
- cout << tab[n] << endl;
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement