#include<stdio.h>
#include<stdlib.h>
#include<time.h>

int b_rand()
{
 return (rand()%2);
}

void main()
{
 int integer,result;


 char answer,answer2;


 srand((unsigned)time(NULL) );


 result = 0;

 

 for (;;)
 {
 printf("앞면 또는 뒷면(1 또는 0):");
  scanf("%d",&integer);

 

 if(integer == rand()%2)
  printf("맞았습니다 계속 하시겠습니까? (y 또는 n) :");
  scanf("%c", &answer);


 if(answer =='y')
 continue;
 else if(answer =='n')
  break;

 

 else if (integer != rand()%2)
 printf("틀렸습니다 계속 하시겠습니까? (y 또는 n) : ");
 scanf("%c", &answer2);


 if(answer2 =='y')
  continue;
 else if(answer2 =='n')
  break;
}
}

 

몇번 잘되다가 갑자기 또 안되요 ㅜㅜ 위에 보시는바와 같이 1 입력하면 또 같은 문구 떠서 1또 입력하면 또 같은 문구뜨고 이래여