题解 | #取近似值#
取近似值
http://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
package main
import "fmt"
func main() {
var input float32
fmt.Scan(&input)
res := int(input * 10)
if res%10 >= 5 {
fmt.Println(res/10 + 1)
} else {
fmt.Println(res / 10)
}
}