Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::borrow::Cow;
- fn main() {
- for i in 1..=100 {
- let output = match i % 15 {
- 3 | 6 | 9 | 12 => Cow::from("Fizz"),
- 5 | 10 => Cow::from("Buzz"),
- 0 => Cow::from("FizzBuzz"),
- _ => Cow::from(i.to_string()),
- };
- println!("{}", output);
- }
- }
Add Comment
Please, Sign In to add comment