- import java.util.Scanner;
- public class Demo44 {
- /**
- * @param args
- */
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- while (true) {
- System.out.println("请输入一个数");
- double d =sc.nextDouble();
- double f = 10.0;
- double s =d + f;
- double ss =Math.round(s);
- System.out.println(s);
- System.out.println(ss);
- }
- }
- }
复制代码
顺便给我讲讲Math.round到底是什么机制,综合图上的结果给讲讲呗,谢谢!在线等! |
|