27 lines
426 B
Go
27 lines
426 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"math/rand"
|
|
)
|
|
|
|
func main() {
|
|
const numElems = 10
|
|
randSlice := make([]int64, numElems)
|
|
for i := 0; i < numElems; i++ {
|
|
randSlice[i] = rand.Int63n(100)
|
|
}
|
|
for _, v := range randSlice {
|
|
if v%6 == 0 {
|
|
fmt.Println("Six!")
|
|
} else if v%2 == 0 {
|
|
fmt.Println("Two!")
|
|
} else if v%3 == 0 {
|
|
fmt.Println("Three!")
|
|
} else {
|
|
fmt.Println("Never mind")
|
|
}
|
|
}
|
|
fmt.Println(randSlice)
|
|
}
|