Advertisement
FloudMe77

Untitled

Mar 27th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.   int n,i;
  6.   int f1=1,f2=2,f3;
  7.   cout<<"Ktora liczbe ciagu chcesz policzyc: ";
  8.   cin>>n;
  9.   cout<<"1. "<<f1<<endl<<"2. "<<f2;
  10.   for(i=2;i<n;i++)
  11.   {
  12.     f3=f1+f2;
  13.     f1=f2;
  14.     f2=f3;
  15.     cout<<endl<<i+1<<". "<<f3;
  16.   }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement