package main
import (
"fmt"
"math"
)
func main() {
a := []int{1, 4, 3, 3, 7, 2, 1, 10}
maxNum := a[0]
second := math.MinInt64
for _, v := range a {
if v > maxNum {
second = maxNum
maxNum = v
}
}
fmt.Println(maxNum, second)
}
网友评论