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