viewimage.php?id=3dafdf21f7d335ab67b1d1&no=24b0d769e1d32ca73ded8efa11d02831ee99512b64ee64d67099c224c4024eaa45af7197442dfd249c8d64f19cad0b45047a96c5d40e4197b541f392b2ff22ec8a68d9d75122

사칙연산 프로그램 만들어보고 있는데 나눗셈에서 프로그램이 이상해져요.


  1. case 4: while (c<=10){
  2. srand((int)time(NULL));
  3. d=rand()%a*10+1;
  4. Sleep(300);
  5. srand((int)time(NULL));
  6. e=rand()%a+1;
  7. while (d%e==0){
  8. srand((int)time(NULL));
  9. d=rand()%a*10+1;
  10. Sleep(300);
  11. srand((int)time(NULL));
  12. e=rand()%a+1;};
  13. printf("%d. %d/%d= ",c,d,e);
  14. scanf("%d",&f);
  15. if (f==d/e){
  16. printf("정답입니다. ");
  17. g+=10;
  18. }
  19. else {
  20. printf("틀렸습니다. ");
  21. }
  22. c++;