當前位置:編程學習大全網 - 源碼下載 - 抽獎程序源碼java

抽獎程序源碼java

外賣班

外賣店(){

numbers = new int[6];

}

作廢外賣(){

int count = 6;

while(count & gt;0) {

int rand =(int)(math . random()* 48+1);

開關(計數){

案例6:

數字[0]= rand;

count-;

打破;

案例5:

if(numbers[0] == rand) {

繼續;

}

numbers[1] =蘭特;

count-;

打破;

案例4:

if(numbers[0]= = rand | | numbers[1]= = rand){

繼續;

}

數字[2] =蘭特;

count-;

打破;

案例三:

if(numbers[0]= = rand | | numbers[1]= = rand | | numbers[2]= = rand){

繼續;

}

數字[3] =蘭特;

count-;

打破;

案例二:

if(numbers[0]= = rand | | numbers[1]= = rand | | numbers[2]= = rand | | numbers[3]= = rand){

繼續;

}

數字[4] =蘭特;

count-;

打破;

案例1:

if(numbers[0]= = rand | | numbers[1]= = rand | | numbers[2]= = rand

| | numbers[3]= = rand | | numbers[4]= = rand){

繼續;

}

數字[5] =蘭特;

count-;

打破;

}

}

}

void顯示(){

for(int I = 0;我& lt數字.長度;i++) {

system . out . print(numbers[I]+" ");

}

}

int[]數字;

}

公共類TakeOutAwardTest {

公共靜態void main(String[] args) {

武勝=新武勝();

for(int I = 0;我& lt5;i++) {

system . out . print(" the "+(I+1)+"抽獎結果:");

wusheng . take out();

wusheng . display();

system . out . println();

}

}

}

  • 上一篇:小毛驢故事
  • 下一篇:算法源代碼集
  • copyright 2024編程學習大全網