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