Created
April 6, 2016 03:48
-
-
Save dd86k/4d9a5e7f8d539513f356697cbc4b372e to your computer and use it in GitHub Desktop.
Rust FizzBuzz two-liner
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() { | |
let mut x; | |
for i in 0..101 { println!("{}", if i % 15 == 0 { "FizzBuzz" } else if i % 5 == 0 { "Buzz" } else if i % 3 == 0 { "Fizz" } else { x = format!("{}", i);x.as_str() } ); } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment