Lotto1 c++ 문제 30. 로또 번호 생성 로또 번호를 생성하여 출력하는 코드를 작성하세요. 번호는 중복되어선 안됩니다. 출력 예) 코드는 아래에~~~~~~~~~~~~~~~~~~~~~ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 #include using namespace std; int main() { std::srand(static_cast(std::time(nullptr))); int lotto[6] = { 0 }; int count = 0; bool isSame = false; while (true) { isSame = false; lotto[count] = std::rand() % 45 + 1; .. 2023. 11. 8. 이전 1 다음 반응형