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.
19 lines
229 B
19 lines
229 B
12 years ago
|
package main
|
||
|
|
||
12 years ago
|
import "fmt"
|
||
|
|
||
12 years ago
|
func main() {
|
||
12 years ago
|
for i := 1; i < 101; i++ {
|
||
|
s := fmt.Sprintf("%d", i)
|
||
12 years ago
|
if i%3 == 0 {
|
||
|
s = "Fizz"
|
||
|
if i%5 == 0 {
|
||
|
s += "Buzz"
|
||
|
}
|
||
|
} else if i%5 == 0 {
|
||
|
s = "Buzz"
|
||
|
}
|
||
12 years ago
|
fmt.Println(s)
|
||
12 years ago
|
}
|
||
|
}
|