29 of 100 menu

Rust Taskbook Level 3.9

Given a certain line, for example, like this:

let txt: &str = "023m0df0dfg0";

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

Given some array, for example, like this:

let 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.

Given an array of strings:

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

Get an array of characters from these strings:

['a', 'b', 'c', 'd', 'e', 'f'];

Two arrays are given:

let 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:

"1,4" "2,5" "3,6"

Given a line:

"abc_abc_abc_abc_abc_abc"

Replace every other underscore with a hyphen:

"abc-abc_abc-abc_abc-abc"
enru