[Java 예제] 로또(a lottery)
자바로 콘솔에 로또 번호를 출력해보자import java.util.Random; import java.util.TreeSet; public class Lotto { int[] lotto; int length; Random random = new Random(); public void makeLotto() { lotto = new int[length]; lotto[0] = random.nextInt(45) + 1; int num = 0; while(num < length) { int temp = random.nextInt(45) + 1; lotto[num] = temp; for(int j = 0; j < num; j++) { if(lotto[j] == temp) { num--; break; } } num+..
2017.02.13