[Java] 取近似值
取近似值
http://www.nowcoder.com/questionTerminal/3ab09737afb645cc82c35d56a5ce802a
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); double number = in.nextDouble(); System.out.println((int)(number + 0.5)); } }