求编个产生随机数的小程序
帮忙编个小程序,能生成0-9的随机数,每4个一组,每组之间用空格隔开,运行时一次产生500组。求代码和生成的EXE程序,谢谢。我信箱tomado@126.com...
帮忙编个小程序,能生成0-9的随机数,每4个一组,每组之间用空格隔开,运行时一次产生500组。求代码和生成的EXE程序,谢谢。我信箱tomado@126.com
展开
1个回答
展开全部
import java.util.Random;
public class RandomShu {
static Random rand = new Random();
private int a1 = rand.nextInt(9);
private int a2 = rand.nextInt(9);
private int a3 = rand.nextInt(9);
private int a4 = rand.nextInt(9);
public String Shuchu() {
return a1 + "," + a2 + "," + a3 + "," + a4;
}
public static void main(String[] args) {
for(int i=0;i<500;i++)
{
RandomShu rs = new RandomShu();
System.out.println(rs.Shuchu());
}
}
}
程序给你了,我是用Java做的 ,怎么打包,我看了,但是没有破解版exe4j,无法生成exe文件,你自己想办法吧
public class RandomShu {
static Random rand = new Random();
private int a1 = rand.nextInt(9);
private int a2 = rand.nextInt(9);
private int a3 = rand.nextInt(9);
private int a4 = rand.nextInt(9);
public String Shuchu() {
return a1 + "," + a2 + "," + a3 + "," + a4;
}
public static void main(String[] args) {
for(int i=0;i<500;i++)
{
RandomShu rs = new RandomShu();
System.out.println(rs.Shuchu());
}
}
}
程序给你了,我是用Java做的 ,怎么打包,我看了,但是没有破解版exe4j,无法生成exe文件,你自己想办法吧
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询