Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- long a = 252149039;
- int c = 11;
- long m =(long) Math.pow(2, 48);
- long seed = System.currentTimeMillis();
- System.out.println("How many Random numbers would you like to get?");
- int number = scanner.nextInt();
- for (int i = 0; i <= number;i++) {
- seed = ((a*seed)+c) % m;
- System.out.println(seed);
- }
- scanner.close();
- }
Add Comment
Please, Sign In to add comment