package My;
import java.util.Random;
public class one{
public static void main(String [] args){
int a[] = new int [6];
int score = (int)(Math.random()*45)+1;
Random r = new Random();
for (int i = 0; i < a.length; i++) {
a[i]=r.nextInt(45)+1;
for (int j = 0; j < i; j++) {
if(a[i]!=a[j]){
continue;
}//if
i-=1;
}//for2
}//for1
for (int i = 0; i <a.length; i++) {
System.out.print(a[i]+"\t");
}
}//main
}//class
검은색깔 굵은 곳 보면
비슷한 랜덤 숫자를 발생시키는 걸 볼 수 있슴
근데 붉은색깔 자리에 score를 선언하면
실행이 안됨, 왜 그런거 ?
똑같이 랜덤 숫자를 발생시키고
a[i]에 리턴시켜주는건데
오타로 socre를 쳤다거나
죽이지 말아주세요 제발
리얼랜덤 부터 만들어 쓰라
https://www.random.org/