import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); float num = scan.nextFloat(); System.out.println(getInt(num)); } public static int getInt(float a){ int b = (int) a; if((a-b)>=0.5) return (b+1); else return b; } } 添加笔记