Last active
October 31, 2016 03:55
-
-
Save matthewjberger/c68d00ca8e89fe27d602b1b4dfa4126f to your computer and use it in GitHub Desktop.
Rusty Fizzbuzz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
for i in 1..101 { | |
match (i % 5, i % 3) { | |
(0, 0) => println!("FizzBuzz"), | |
(0, _) => println!("Fizz"), | |
(_, 0) => println!("Buzz"), | |
(_, _) => println!("{}", i), | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment