Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n,a[50];
- cout<<"Hany lepcsofok:";
- cin>>n;
- a[1]=1;
- a[2]=1;
- for(int i=3;i<=n;i++)
- {
- a[i]=a[i-1]+a[i-2];
- cout<<i<<". lepcsofokra "<<a[i]<<" fele keppen lephetek."<<endl;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment