diff options
Diffstat (limited to 'Project1/helper.cpp')
| -rw-r--r-- | Project1/helper.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Project1/helper.cpp b/Project1/helper.cpp index de05926..a90fc36 100644 --- a/Project1/helper.cpp +++ b/Project1/helper.cpp @@ -43,4 +43,18 @@ void Print(const std::list<int>& myList) std::cout << i << std::endl; } +} + +void Fibonacci(int(&cArray)[SIZE]) +{ + cArray[0] = 0; + cArray[1] = 1; + for (int i = 2; i < SIZE; i++) + { + cArray[i] = cArray[i - 1] + cArray[i - 2]; + } + for (int i = 0; i < SIZE; i++) + { + cout << cArray[i] << " "; + } }
\ No newline at end of file |