#include #include #include #define NUM 45 int main(void) {//srand()ÇÔ¼ö¿Í time()ÇÔ¼ö¸¦ »ç¿ëÇÑ ¼ýÀÚ 6°³¸¦ Ãâ·Â int cnt; printf("1~45 Áß¿¡¼­ ¼ýÀÚ 6°³ Ãâ·Â\n"); srand((unsigned)time(NULL)); printf("srand() Ãâ·Â : "); for (cnt = 1; cnt <= 6; cnt++) printf("\n%d: %d", cnt, 1 + (rand() % NUM)); printf("\n"); return 0; }