GOLANG学习4. 函数的多返回值
package main
import (
"fmt"
)
func cale(a int, b int) (int, int) {
sum := a + b
avg := (a + b) / 2
return sum, avg
}
func main() {
sum, avg := cale(200, 400)
fmt.Println("sum=", sum, ";avg=", avg)
}
其实我一直在你身边
package main
import (
"fmt"
)
func cale(a int, b int) (int, int) {
sum := a + b
avg := (a + b) / 2
return sum, avg
}
func main() {
sum, avg := cale(200, 400)
fmt.Println("sum=", sum, ";avg=", avg)
}