Go题库7_取近似值
package main import ( "fmt" ) func main() { var input float64 _, err := fmt.Scanf("%f", &input) if err != nil { return } fmt.Println(int(input + 0.5)) }
package main import ( "fmt" ) func main() { var input float64 _, err := fmt.Scanf("%f", &input) if err != nil { return } fmt.Println(int(input + 0.5)) }