2022-02-19 16:40:18 +04:00

28 lines
668 B
Rust

// option1.rs
// Make me compile! Execute `rustlings hint option1` for hints
<<<<<<< HEAD
// you can modify anything EXCEPT for this function's sig
=======
// I AM NOT DONE
// you can modify anything EXCEPT for this function's signature
>>>>>>> upstream/main
fn print_number(maybe_number: Option<u16>) {
println!("printing: {}", maybe_number.unwrap());
}
fn main() {
print_number(Some(13));
print_number(99.into());
let mut numbers: [Option<u16>; 5] = Default::default();
for iter in 0..5 {
let number_to_add: u16 = {
((iter * 1235) + 2) / (4 * 16)
};
numbers[iter as usize] = number_to_add.into();
}
}