📄 library.java
字号:
//Copyright (c) 1998, Arthur Gittleman
//This example is provided WITHOUT ANY WARRANTY either expressed or implied.
/* Uses methods from the Math class
*/
import iopack.Io;
public class Library {
public static void main(String [] args) {
System.out.println("Two cubed is " + Math.pow(2.0,3.0));
System.out.println("Three squared is " + Math.pow(3.0,2.0));
System.out.println("The square root of two is " + Math.sqrt(2.0));
System.out.println("The square root of 16 is " + Math.sqrt(16.0));
System.out.println("The max of 2.56 and 7.91/3.1 is " + Math.max(2.65,7.91/3.1));
System.out.println("The min of -9 and -11 is " + Math.min(-9,-11));
System.out.println("The absolute value of -32.47 is " + Math.abs(-32.47));
System.out.println("The floor of 25.194 is " + Math.floor(25.194));
System.out.println("The ceiling of 25.194 is " + Math.ceil(25.194));
System.out.println("Pi is " + Math.PI);
System.out.print("Pi, to six decimal places, is ");
Io.println(Math.PI,6);
System.out.println("The base of natural logarithms, e, is " + Math.E);
Io.readString("Press any key to exit"); // Added for IDE use
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -