36 of 100 menu

Rust Taskbook Level 4.6

Given a string, check that this string consists only of numbers.

Given a vector:

vec![1, 0, 2, 3, 0, 5]

Remove all zeros from the vector:

[1, 2, 3, 5]

Given a vector:

let vct: Vec<i16> = Vec::new();

Write code that will fill this vector with powers of two to the nth power:

[2, 4, 8, 16, 32]

Given an integer:

let num: u16 = 12345;

Get the first even digit from the end of this number.

Write a program that will generate the following string:

"54321"

Given an array of integers:

let arr = [123, 102, 345, 350];

Write into the new vector those numbers that contain the digit zero.

Given a line:

"abcdef"

Get every second character of this string:

"acf"
enru