domath.java
来自「程序练习中包括书中实例程序代码和练习中要用到的代码,是压缩文件」· Java 代码 · 共 18 行
JAVA
18 行
package examples.basic;
/** a class to demonstrate the Math class
* and working with primitive types */
public class DoMath {
public static void main( String[] args ) {
double y = 5.678;
double x = Math.sqrt( y );
float a = -4.56F;
float b = Math.abs( a );
int r = 56;
float s = -67.5F;
int t = (int) Math.max( r, s );
System.out.println( x );
System.out.println( b );
System.out.println( t );
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?