Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n;
- int i = 0, a, b = 0, c = 1;
- cin >> n;
- while(i < n)
- {
- cout << c << endl;
- a = b;
- b = c;
- c = a + b;
- ++i;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment