name | correct guesses | games together | ratio |
---|
name | correct guesses | games together | ratio |
---|
1 2 3 4 5 | fn main() { let fb: [&str; 4] = ["", "Fizz", "Buzz", "FizzBuzz"]; for i in 1..=100 {let mut idx = ((i % 3 == 0) as usize * 1) + ((i % 5 == 0) as usize * 2); if idx == 0{idx = 5;}println!("{}", fb.get(idx).unwrap_or(&i.to_string().as_str()));} } |
post a comment