Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- #include <time.h>
- #include <math.h>
- using namespace std;
- int main()
- {
- int odp;
- double tab[1000];
- //napisz program, ktory spyta Cię, ktora liczbe Fibonacciego ma Ci podać
- cout<<"Ktora liczbe Fib mam Ci podać?"<<endl;
- cin>>odp;
- tab[0]=1;
- tab[1]=1;
- for(int i=2;i<=odp;i++)
- {
- tab[i]=tab[i-1]+tab[i-2];
- cout<<tab[i]<<endl;
- }
- cout<<tab[odp];
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement