纯随机数生成器

 

 

package demo;

 
import java.util.Scanner;
 
public class Demo {
    public static void main(String[] args) {
         
        Scanner sc = new Scanner(System.in);
        int size = sc.nextInt();
        Demo.myRandom(3, size);
    }
     
    public static void myRandom(int x0, int size) {
        int x;
        x = x0;
        String s = new String();
        for(int i=0; i<size; i++) {
            x *= 214013;
            x += 2531011;
            s += (x >> 16) & 0xff;
            System.out.println(s);
            s = "";
        }
    }
}
 
 
 
 
posted @ 2022-10-06 20:00  秃头的小白  阅读(30)  评论(0)    收藏  举报