-
-
Save chikoski/25c84918885d514bc073a7a494c95fdc 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(number: u32) -> String{ | |
if number % 15 == 0 { | |
"fizzbuzz".to_owned() | |
}else if number % 5 == 0 { | |
"buzz".to_owned() | |
}else if number % 3 == 0 { | |
"fizz".to_owned() | |
}else{ | |
format!("{}", number) | |
} | |
} | |
fn main(){ | |
for number in 0..50{ | |
println!("{}", fizzbuzz(number)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment