题解 | #取近似值#
取近似值
http://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
double num = scanner.nextDouble();
int n = (int) num;
if ((num - n) >= 0.5) {
System.out.println(n + 1);
} else {
System.out.println(n);
}
}
}