diff options
| Commit | 5e9cb4ddc811465731596d8ee684f3d8cd5a6aea (patch) | |
|---|---|---|
| Author | 2026-05-02 16:05:06 +0300 | |
| Committer | 2026-05-02 16:05:06 +0300 | |
| Files | 33a9268d1136974d2ef138364dde508ba43b4a52 /Week11/Exercise04/main.cpp | |
| oop-2025-solutions-main.tar oop-2025-solutions-main.tar.gz oop-2025-solutions-main.zip | ||
| Parent | 7546f0d0da487e16f0a8671c09a46e1cee2bc03a (diff) | |
1 files changed, 23 insertions, 0 deletions
| -rw-r--r-- | Week11/Exercise04/main.cpp | 23 |
diff --git a/Week11/Exercise04/main.cpp b/Week11/Exercise04/main.cpp new file mode 100644 index 0000000..cdf3555 --- /dev/null +++ b/Week11/Exercise04/main.cpp @@ -0,0 +1,23 @@ +#include "Vector.hpp" +#include <iostream> + +void print(const Vector<int> numbers) { + for (unsigned i = 0; i < numbers.Count(); ++i) + std::cout << numbers[i] << ' '; + std::cout << std::endl; +} + +int main() { + Vector<int> nums; + nums.PushBack(1); + nums.PushBack(2); + nums.PushBack(3); + + Vector<int> numsMore(nums); + numsMore.PushBack(4); + numsMore.PushBack(5); + + print(nums + numsMore); + + return 0; +} |
