Rust Taskbook Level 3.9

Задание 1

Given a certain line, for example, like this:

rustlet txt: &str = "023m0df0dfg0";

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

Задание 2

Given some array, for example, like this:

rustlet arr: [i8; 6] = [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:

rustlet arr = ["ab", "cd", "ef"];

Get an array of characters from these strings:

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

Two arrays are given:

javalet arr1: [i8: 5] = [1, 2, 3];
let arr2: [i8: 5] = [4, 5, 6];

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

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

Given a line:

rust"abc_abc_abc_abc_abc_abc"

Replace every other underscore with a hyphen:

rust"abc-abc_abc-abc_abc-abc"