여기서 막히네요.. 도와주세요
청식
이부분질문좀.컴파일에러질문 내용 : 숫자야구게임인데요 숫자 3개가 정답 3개하고 완전히 하나도 안맞을경우 out을 출력을 할라고하는데요 제가 빨간색으로 적은부분에서 계속 에러가나네요 어떻게 하면 에러가안나고 정답 3개하고 숫자가 하나도안맞을경우 out을 출력할수있을까요?
#include stdio.h
#include stdlib.h
#include time.h
int main(void)
{
int input_n1,input_n2,input_n3;
int rand_n1,rand_n2,rand_n3;
int count=0;
srand((int)time(null)); while (1) {
rand_n1=rand()%9+1;
rand_n2=rand()%9+1;
rand_n3=rand()%9+1;
if(rand_n1==rand_n2 || rand_n1==rand_n3 || rand_n2==rand_n3)
continue;
break;
}
while(1)
{
int strike=0,ball=0;
scanf(%d %d %d,&input_n1,&input_n2,&input_n3);
if(rand_n1==input_n1)
strike++;
else if(rand_n2==input_n1 || rand_n3==input_n1)
ball++;
if(rand_n2==input_n2)
strike++;
else if(rand_n1==input_n2 || rand_n3==input_n2)
ball++;
if(rand_n3==input_n3)
strike++;
else if(rand_n1==input_n3 || rand_n2==input_n3)
ball++;
else(rand_n1==!input_n1 && rand_n2==!input_n2 && rand_n3==!input_n3) 이부분에요 랜드값n1과입력값 n1이 동일하지않고 랜드값 n2와 입력값 n2값이 동일하지않고 랜드값 n3과입력값 n3이 동일하지않을때 out을 출력한다 이렇게 적은건데 이게아닌가요? 어떻게하면될까요? ㅠ
{
printf(out\n\n);
}
printf(%d strike %d ball\n,strike,ball);
printf(%d out\n\n,3-strike-ball);
printf(정답을 입력하시오 \n);
printf(answer:\n);
if(strike==3)
break;
}
return 0;
}