1 // blank_identifer 2 package main 3 4 import ( 5 "fmt" 6 //"math" 7 ) 8 9 func main() { 10 var a, b int 11 var c float32 12 //a, b, c = treeValues(10, 11, float32(math.Floor(12.3111))) 13 a, b, c = treeValues(10, 11, 312.33332)
//这里的g是看文档做的,但是没有理解中文文档里的意思 14 fmt.Printf("a=%d, b=%d, c=%1.4g", a, b, c) 15 } 16 func treeValues(j int, p int, g float32) (a int, b int, c float32) { 17 a = j 18 b = p 19 c = g 20 21 return 22 }
输出:
a=10, b=11, c=312.3成功: 进程退出代码 0.