import java.util.List;
import java.util.*;
public class test{
public static void main(String args[])
{
int N1,N2,N3,N4,N5,N6,bonus;
ArrayList numbers = new ArrayList();
for(int i=1;i<=7;i++)
{
numbers.add(i);
}
// numbers.add(1~42);
Collections.shuffle(numbers);
N1=Integer.parseInt(numbers.get(0).toString());
N2=Integer.parseInt(numbers.get(1).toString());
N3=Integer.parseInt(numbers.get(2).toString());
N4=Integer.parseInt(numbers.get(3).toString());
N5=Integer.parseInt(numbers.get(4).toString());
N6=Integer.parseInt(numbers.get(5).toString());
bonus=Integer.parseInt(numbers.get(6).toString());
System.out.println(N1);
System.out.println(N2);
System.out.println(N3);
System.out.println(N4);
System.out.println(N5);
System.out.println(N6);
System.out.println(bonus);
}
}
沒有留言:
張貼留言