import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); double d= scanner.nextDouble(); //write your code here...... // 取符号位 int symbol=1; if(d<0) symbol=-1; // 获得正整数 int left=(int) d; left=left>0?left:-left; // 获得小数,判断是否进位 int right=(int) (d*10)%10; if(right>=5) left+=1; int i=symbol*left; System.out.println(i); } }