You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
357 B

5 years ago
5 years ago
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<time.h>
  4. #define NUM 45
  5. int main(void)
  6. {//srand()�Լ��� time()�Լ��� ������ ���� 6���� ����
  7. int cnt;
  8. printf("1~45 �߿��� ���� 6�� ����\n");
  9. srand((unsigned)time(NULL));
  10. printf("srand() ���� : ");
  11. for (cnt = 1; cnt <= 6; cnt++)
  12. printf("\n%d: %d", cnt, 1 + (rand() % NUM));
  13. printf("\n");
  14. return 0;
  15. }