diff options
feat(Week07): Add solutions
1 files changed, 29 insertions, 0 deletions
| -rw-r--r-- | Week07/Exercise12.cpp | 29 |
diff --git a/Week07/Exercise12.cpp b/Week07/Exercise12.cpp new file mode 100644 index 0000000..9fdfd05 --- /dev/null +++ b/Week07/Exercise12.cpp @@ -0,0 +1,29 @@ +#include <iostream> + +void incArr(int* arr, unsigned int size) { + for (unsigned int i = 0; i < size; i++) + arr[i]++; +} + +int main() { + const unsigned int SIZE1 = 10, SIZE2 = 9; + int series1[SIZE1], series2[SIZE2]; + + for (unsigned int i = 0; i < SIZE1; i++) + std::cin >> series1[i]; + for (unsigned int i = 0; i < SIZE2; i++) + std::cin >> series2[i]; + + incArr(series1, SIZE1); + incArr(series2, SIZE2); + + for (unsigned int i = 0; i < SIZE1; i++) + std::cout << series1[i] << ' '; + std::cout << std::endl; + + for (unsigned int i = 0; i < SIZE2; i++) + std::cout << series2[i] << ' '; + std::cout << std::endl; + + return 0; +} |
