C++ Taskbook Level 3.9

Задание 1

Given a certain line, for example, like this:

cppstd::string str = "023m0df0dfg0";

Print to the console the positions of all zeros in this line.

Задание 2

Given some array, for example, like this:

cppint arr = {1, 2, 3, 4, 5, 6};

Divide the sum of the first half of the elements of this array by the sum of the second half of the elements.

Задание 3

Given an array of strings:

cppstd::string arr[] = {"ab", "cd", "ef"};

Get an array of characters from these strings:

cppchars[] {'a', 'b', 'c', 'd', 'e', 'f'};
Задание 4

Two arrays are given:

javaint arr[]1 = {1, 2, 3};
int arr[]2 = {4, 5, 6};

Loop through these arrays and print their elements in each iteration as follows:

cpp"1,4"
"2,5"
"3,6"
Задание 5

Given a line:

cpp"abc_abc_abc_abc_abc_abc"

Replace every other underscore with a hyphen:

cpp"abc-abc_abc-abc_abc-abc"