26 lines
329 B
Plaintext
26 lines
329 B
Plaintext
let mut count = 1
|
|
|
|
while count <= 15 {
|
|
let divides_by_3 = count % 3 == 0
|
|
let divides_by_5 = count % 5 == 0
|
|
|
|
if divides_by_3 && divides_by_5 {
|
|
write_line("fizzbuzz")
|
|
return
|
|
}
|
|
|
|
if divides_by_3 {
|
|
write_line("fizz")
|
|
return
|
|
}
|
|
|
|
if divides_by_5 {
|
|
write_line("buzz")
|
|
return
|
|
}
|
|
|
|
write_line(count)
|
|
|
|
count += 1
|
|
}
|