chroma-syntaxis/samples/fizzbuzz.rs

11 lines
245 B
Rust

fn main() {
for n in 1..=100 {
match (n % 3, n % 5) {
(0, 0) => println!("Fizz buzz"),
(0, _) => println!("Fizz"),
(_, 0) => println!("Buzz"),
_ => println!("{}", n),
}
}
}