Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- int main()
- {
- int x = 1, y = 0, z;
- cin >> z;
- for (int i = 1; i <= z; i++)
- {
- if (i % 2 == 0)
- {
- x += y;
- cout << x << endl;
- }
- else
- {
- y += x;
- cout << y << endl;
- }
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement