diff --git a/day7/homework/oh3.cpp b/day7/homework/oh3.cpp index 8072471..14d22d4 100644 --- a/day7/homework/oh3.cpp +++ b/day7/homework/oh3.cpp @@ -13,8 +13,13 @@ int main() int a = 1; int b = 1; int c = 0; - cout << a << "\t" << b << "\t"; - while (c <= n) + + if (n >= 1) + cout << a << "\t"; + if (n >= 2) + cout << b << "\t"; + + while (n > 2 && c <= n) { c = a + b; if (c <= n)