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

17 lines
201 B
Plaintext

package main
import "fmt"
func main() {
Max := func(nums ...int) int {
max := -1 << 63
for _, i := range nums {
if max < i {
max = i
}
}
return max
}
fmt.Println(Max(3, 2, 1))
}