21 lines
310 B
Plaintext
21 lines
310 B
Plaintext
let mut count = 1
|
|
|
|
while count <= 15 {
|
|
let divides_by_3 = count % 3 == 0
|
|
let divides_by_5 = count % 5 == 0
|
|
|
|
let output = if divides_by_3 && divides_by_5 {
|
|
"fizzbuzz"
|
|
} else if divides_by_3 {
|
|
"fizz"
|
|
} else if divides_by_5 {
|
|
"buzz"
|
|
} else {
|
|
count.to_string()
|
|
}
|
|
|
|
write_line(output)
|
|
|
|
count += 1
|
|
}
|