Goofing around with some teensy FizzBuzz
This commit is contained in:
15
zzz/fizzbuzz/main.go
Normal file
15
zzz/fizzbuzz/main.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
for i, s := 1, ""; i < 101; i++ {
|
||||
if i%3 == 0 {
|
||||
s = "Fizz"
|
||||
if i%5 == 0 {
|
||||
s += "Buzz"
|
||||
}
|
||||
} else if i%5 == 0 {
|
||||
s = "Buzz"
|
||||
}
|
||||
print(s)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user