一:if...else...
1 package main 2 3 import "fmt" 4 5 func main() { 6 var num = 10 7 var num2 = 20 8 res := test(num, num2) 9 fmt.Println(res) 10 } 11 12 func test(num, num2 int) int { 13 var result int 14 if num > num2 { 15 result = num 16 } else { 17 result = num2 18 } 19 return result 20 }
标签:语句,20,num2,int,num,result,条件,var From: https://www.cnblogs.com/shixiaogu/p/16851913.html