go-examples/go-hello/min_slice.txt

22 lines
223 B
Plaintext
Raw Normal View History

2017-07-07 12:29:36 +00:00
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)
}