Commit 72f1b783 by 朽木不可雕也

backup

parent d68de549
package demo;
import org.junit.jupiter.api.Test;
/**
* @author aszswaz
* @createTime 2021-08-25 18:08:23
* @ide IntelliJ IDEA
*/
@SuppressWarnings("JavaDoc")
class RandmoDemo {
/**
* 随机 0 - 5 之间的数字
*/
@Test
void randmo01() {
for (int i = 0; i < 100; i++) {
double randmo = Math.random();
System.out.println(randmo);
System.out.println(randmo * 5);
System.out.println("============================");
}
}
/**
* 随机 5 - 10 之间的数字
*/
@Test
void randmo02() {
for (int i = 0; i < 100; i++) {
double randmo = Math.random();
System.out.println(randmo);
// + 1 表示需要包括 10
System.out.println(5 + randmo * (10 - 5 + 1));
System.out.println("============================");
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment