go-examples/go-hello/min_slice.txt
2017-07-07 14:29:36 +02:00

22 lines
223 B
Plaintext

package main
import (
"fmt"
)
func main() {
x := []int{
48, 96, 86, 68,
57, 82, 63, 70,
37, 34, 83, 27,
19, 97, 9, 17,
}
min := x[0]
for _, i := range x {
if i < min {
min = i
}
}
fmt.Println(min)
}