This question already has an answer here:
import java.util.Random;
public class Lucklip {
public static void main(String[] args) {
Random rn = new Random();
int[] ticket = {0,0,0,0,0,0};
for(int i =0; i < 6; i++)
{
int answer = 1+rn.nextInt(50);
ticket[i] = answer;
System.out.println(answer);
}
System.out.print("ticket is");
for (int i=0; i< 6; i++){
System.out.print(" " + ticket[i]);
}
System.out.println("");
}
}
Aucun commentaire:
Enregistrer un commentaire