Advertisement
ItsMeLucifer

Fibonacii C++

Apr 23rd, 2019
422
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     long long tab[100];
  8.     tab[0]=1;
  9.     tab[1]=1;
  10.     cout<<tab[0]<<" "<<tab[1];
  11.     for(int i=2;i<100;i++)
  12.     {
  13.         tab[i]=tab[i-2]+tab[i-1];
  14.         cout<<" "<<tab[i]<<" ";
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement