原帖及讨论:http://bbs.bc-cn.net/dispbbs.asp?boardid=5&id=108910
import java.io.*;
import java.util.Random;
class num
{
public static void main(String[]args)
{
//声明一个随机数组
int sjsh[]=new int[7];
int sum;
try
{
InputStreamReader a=new InputStreamReader(System.in);
BufferedReader b=new BufferedReader(a);
System.out.println ("欢迎使用齐鲁风采30选7彩票随机系统!");
System.out.print ("请选择投注数:");
String s=b.readLine();
int sh=Integer.parseInt(s);
//给随机数组赋随机值 且 保证没有重复
for (int i = 0; i<sh; i++)
{
for (int j = 0; j<7; j++)
{
Random rnd = new Random();
sjsh[j] = rnd.nextInt(31);
switch(j)
{
case 0:;break;
case 1:
{
if(sjsh[j]==sjsh[j-1])
j--;
};break;
case 2:
{
if(sjsh[j]==sjsh[j-1]||sjsh[j]==sjsh[j-2])
j--;
&n