Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<iomanip>
- #include<cmath>
- #include<algorithm>
- // #include <algorithm>
- using namespace std;
- void Ahmed_Negm(){
- #ifndef ONLINE_JUDGE
- freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
- #endif
- }
- int main()
- {Ahmed_Negm();
- long long n, first = 0, second = 1, sum =0;
- cin>>n;
- cout<<first<<" "<<second<<" ";
- for(int i = 2; i<n; i++){
- sum = first + second;
- cout<<sum<<" ";
- first = second;
- second = sum;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement