Guest User

Untitled

a guest
May 23rd, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. use std::borrow::Cow;
  2.  
  3. fn main() {
  4. for i in 1..=100 {
  5. let output = match i % 15 {
  6. 3 | 6 | 9 | 12 => Cow::from("Fizz"),
  7. 5 | 10 => Cow::from("Buzz"),
  8. 0 => Cow::from("FizzBuzz"),
  9. _ => Cow::from(i.to_string()),
  10. };
  11.  
  12. println!("{}", output);
  13. }
  14. }
Add Comment
Please, Sign In to add comment