标签:
/********************************************************
* 浮点数的计算
*
* System.out.println("整形和浮点型的除法比较:");
*
* System.out.println("10 / 3 * 3=" + 10 / 3 * 3);
*
* System.out.println("10 / 3.0 * 3=" + 10 / 3.0 * 3);
*
* System.out.println("浮点数的精度:" + (1.2 - 1.1) * 10);
*
* int foot;
*
* int inch;
*
* Scanner in = new Scanner(System.in);
*
* System.out.print("请输入英尺:");
*
* foot = in.nextInt();
*
* System.out.print("请输入英寸:");
*
* inch = in.nextInt();
*
* System.out.println("foot=" + foot + ",inch=" + inch);
*
* System.out.println("转换结果:" + ((foot + inch / 12.0) * 0.3048) +
* "单位:(m)");
***********************************************************/
/***********************************************************
* 输入
*
* System.out.println( "Hello World!");
*
* Scanner in = new Scanner(System.in);
*
* System.out.println("echo:" +in.nextLine());
*
* int amount = 100;
*
* int price = 0; System.out.print("请输入票面:");
*
* amount = in.nextInt(); System.out.print("请输入金额:");
*
* price = in.nextInt();
*
*
* System.out.println(amount + "-" + price + "=" + (amount - price));
***
标签:
原文地址:http://www.cnblogs.com/zoudajia/p/5497732.html