From c5f68f74a4aea99e91c3529b461dba109eba130f Mon Sep 17 00:00:00 2001 From: Nataliia Brown Date: Fri, 9 Feb 2024 09:41:16 -0800 Subject: final --- homework 4/program.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'homework 4/program.cpp') diff --git a/homework 4/program.cpp b/homework 4/program.cpp index 4eee49e..4c3f420 100644 --- a/homework 4/program.cpp +++ b/homework 4/program.cpp @@ -36,18 +36,18 @@ void PrintFibonacci(size_t n) { for (int i = 1; i <= k; ++i) { if (i == 1) { - cout << t1 << ", "; + cout << t1 << " "; continue; } if (i == 2) { - cout << t2 << ", "; + cout << t2 << " "; continue; } nextTerm = t1 + t2; t1 = t2; t2 = nextTerm; - cout << nextTerm << ", "; + cout << nextTerm << " "; } @@ -108,14 +108,7 @@ int main() { PrintFibonacci(i); } - else if (i == 4) - { - return 0; - } - else - { - cout << "Print Menu"; - } + int j; Menu(); @@ -123,7 +116,7 @@ int main() { i = j; } - + return 0; } -- cgit v1.2.3