Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.31 KB | None | 0 0
  1. package main
  2. import "fmt"
  3. func main () {
  4.     for i := 1; i < 101; i++ {
  5.         result := ""
  6.         switch {
  7.         case i % 3 == 0 : result += "Fizz"; fallthrough
  8.         case i % 5 == 0 : result += "Buzz"
  9.         default :         result = fmt.Sprintf("%d", i)
  10.         }
  11.         fmt.Println(result)
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement