Vector를 이용한 로또 예제
--------------------------------
import java.util.Collections;
import java.util.Random;
import java.util.Vector;
public class VectorLotto {
public static void main(String[] args){
Vector
Random ran = new Random();
Integer ir = null;
while(vc.size()<6) {
ir = new Integer(ran.nextInt(45)+1);
// 중복값 체크
if(!vc.contains(ir)) {
vc.add(ir);
}
//정렬
Collections.sort(vc);
}
for(int i=0;i
덧글