Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int f1, f2, f, n, i; ///variabile globale
- int main()
- {
- cin>>n;
- f1=f2=1;///atribuire multipla
- if(n==1) cout<<f1;
- else
- {
- cout<<f1<<" "<<f2<<" ";
- ///generam
- for(i=3; i<=n;i++)
- {
- f=f1+f2;
- cout<<f<<" ";
- f1=f2;
- f2=f;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement