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