Created
July 24, 2017 06:44
-
-
Save silphire/eaba149aab44b82ce644d480c9d8fdd1 to your computer and use it in GitHub Desktop.
This file contains 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 fizzbuzz() { | |
for x in 1..100 { | |
if x % 3 == 0 { | |
print!("Fizz "); | |
} else if x % 5 == 0 { | |
print!("Buzz "); | |
} else if x % 3 == 0 && x % 5 == 0 { | |
print!("FizzBuzz "); | |
} else { | |
print!("{} ", x); | |
} | |
} | |
println!(""); | |
} | |
fn main() { | |
fizzbuzz(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment