September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -1,12 +1,11 @@
use std::borrow::Cow;
fn main() {
for i in 1..101 {
let word: Cow<_> = match (i % 3, i % 5) {
(0,0) => "FizzBuzz".into(),
(0,_) => "Fizz".into(),
(_, 0) => "Buzz".into(),
_ => i.to_string().into(),
};
println!("{}", word);
let result = (1..101).map(|n| match (n % 3, n % 5) {
(0, 0) => "FizzBuzz".to_owned(),
(0, _) => "Fizz".to_owned(),
(_, 0) => "Buzz".to_owned(),
_ => n.to_string()
});
for r in result {
println!("{}", r);
}
}