PARTIALLY SOLVED

This commit is contained in:
red 2021-07-07 21:03:42 +01:00
parent aa2ce0ee19
commit 84bb490545

View file

@ -9,15 +9,16 @@ fn print_number(maybe_number: Option<u16>) {
} }
fn main() { fn main() {
print_number(13); // rustc suggested solutions
print_number(99); print_number(Some(13));
print_number(Some(99));
let mut numbers: [Option<u16>; 5]; let numbers: [Option<u16>; 5];
for iter in 0..5 { for iter in 0..5 {
let number_to_add: u16 = { let number_to_add: u16 = {
((iter * 1235) + 2) / (4 * 16) ((iter * 1235) + 2) / (4 * 16)
}; };
numbers[iter as usize] = number_to_add; numbers[iter as usize] = Some(number_to_add);
} }
} }