1. foreach

  1. var inputs = [...]int{0, 1, 3, 9, 27, 33, 54, 81}
  2. for _, e := range inputs {
  3. fmt.Println(isPowerOfThree(e))
  4. }