go-examples/go-hello/max.txt

17 lines
201 B
Plaintext
Raw Normal View History

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