ch2ex16.java
来自「JAVA程序设计 丁岳伟 彭敦陆编著 高等教育出版社示例代码可供JAVA初学者学」· Java 代码 · 共 13 行
JAVA
13 行
public class ch2ex16{
public static void main(String[]args){
double c;
c=Math.random();
System.out.print("Random value=");
System.out.println(c);
int x;
//Convert to integer value
x=(int)(c*1000000)%50;
System.out.print("Random value in the range 0...49=");
System.out.println(x);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?