diff options
feat(Week05): Add exercises and solutions
1 files changed, 24 insertions, 0 deletions
| -rw-r--r-- | Week05/Exercise16.cpp | 24 |
diff --git a/Week05/Exercise16.cpp b/Week05/Exercise16.cpp new file mode 100644 index 0000000..21652e5 --- /dev/null +++ b/Week05/Exercise16.cpp @@ -0,0 +1,24 @@ +#include <iostream> + +int main() { + const unsigned int SIZE = 5; + + int row1[SIZE], row2[SIZE]; + for (int i = 0; i < SIZE; i++) { + std::cin >> row1[i]; + } + for (int i = 0; i < SIZE; i++) { + std::cin >> row2[i]; + } + + for (int i = 0; i < SIZE * 2; i++) { + if (i % 2 == 0) + std::cout << row1[i / 2] << ' '; + else + std::cout << row2[(i - 1) / 2] << ' '; + } + + std::cout << std::endl; + + return 0; +} |
