반응형 로또번호1 [c언어] 로또번호 생성기 #include #include #include void main() { srand((unsigned)time(NULL)); int Lotto[50] = { 0 }; for (int i = 0; i < 50; i++) { Lotto[i] = i + 1; } while (true) { char Set = 0; printf("로또번호를 뽑으시겠습니까? Y/N:"); scanf_s("%c", &Set); getchar(); if (Set == 'y') { for (int i = 0; i < 50; i++) //50번 섞기 { int randNum1 = rand() % 51; int randNum2 = rand() % 51; int temp; temp = Lotto[randNum1]; Lotto[randNum1.. 2020. 4. 2. 이전 1 다음 반응형