package text; import java.util.Scanner; public class random { public static void main(String[] args) { int a=13, b=35,m=87,Xo=19; int z=Xo; System.out.print("请输入生成随机数的个数:"); Scanner cin1=new Scanner(System.in); int j=cin1.nextInt(); int q=0; for(int n=0;n<j;n++){ int y=n+1; int Xy=(a*z +b )% m; z=Xy; q++; System.out.print(z+"\t"); if (q % 10 == 0) System.out.print("\n"); } } }
原文地址:https://www.cnblogs.com/fengjingfei/p/11595296.html
时间: 2024-11-18 15:26:38