Advertisement
Guest User

fibonaccio

a guest
Mar 18th, 2017
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <iostream>
  2. int main()
  3. {
  4. int fib[10000];
  5. int n;
  6. using namespace std;
  7.  
  8. cout << "Podaj ile liczb wyznaczyc \n";
  9. cin >> n;
  10.  
  11. fib[0]=1; //
  12. fib[1]=1; //
  13.  
  14. for (int i = 1; i<n ;i++) //od 1 do 1<20 1,2,3,4...19
  15. {
  16. fib[i] = fib[i-1]+fib[i-2]; //
  17. cout <<"\n"<< fib[i];
  18. }
  19.  
  20. return( 0 );
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement