题解 | #掷骰子游戏#
掷骰子游戏
http://www.nowcoder.com/practice/7b543bee3dc14c49a7b340b2e04209ce
import java.util.Random; import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
while (scanner.hasNextInt()) {
int seed = scanner.nextInt();
Random random = new Random(seed);
//write your code here......
System.out.print(random.nextInt(6)+1);
}
}
}