彩票(2)

package com.lovo.bean;

import java.util.ArrayList;
import java.util.List;

public class Qiu {

public final int [] red=new int[32];
public final int []blue=new int[16];
public void run(){
this.hongQiu();
this.lanQiu();

}
private void hongQiu(){
for(int i=0;i<7;i++){
for(int j =0;j<red.length;j++){
int r = (int) (Math.random() * 33)+1;
red [j] =r;

}
}
System.out.print("红球为:");
for(int h=0;h<6;h++){
if(red[h]!=red[h+1])
System.out.print(red[h]+" ");

}
}
private void lanQiu(){
for(int i=0;i<1;i++){
for(int b =0;b<blue.length;b++){
int n = (int) (Math.random() * 16)+1;
blue [b] =n;
}
}
System.out.print(" 蓝球为:");
for(int k=0;k<1;k++){
System.out.println(blue[k]);
}
}

}






 

posted @ 2016-05-22 17:11  钟振杰  阅读(146)  评论(0编辑  收藏  举报