You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
316 B
18 lines
316 B
1 year ago
|
fn main() {
|
||
|
let mut n = 1;
|
||
|
|
||
|
while n < 101 {
|
||
|
if n % 15 == 0 {
|
||
|
println!("fizzbuzz");
|
||
|
} else if n % 3 == 0 {
|
||
|
println!("fizz");
|
||
|
} else if n % 5 == 0 {
|
||
|
println!("buzz");
|
||
|
} else {
|
||
|
println!("{}", n);
|
||
|
}
|
||
|
|
||
|
n += 1;
|
||
|
}
|
||
|
}
|