고수님들 답변 부탁합니다.
선아
2023.07.01
#include stdio.h
#include stdlib.h
#include conio.h
#include time.h
#include windows.h
int main(void)
{
int a,b,c;
srand((unsigned)time(NULL));
a=(rand()%3);
printf(\n\n박정임 오빠님께서 짜신거다.\n\n);
sleep(1000);
printf(이름하여 가위바위보 님이시다!!);
printf(자 1.가위 2.바위 3.보 );
scanf(%d,b);
c=(b%3);
if(c=1)
{
printf(호오~ 가위를 내셨군.);
}
if(c=2)
{
printf(호오~ 바위를 내셨군.);
}
if(c=3)
{
printf(호오~ 보를 내셨군.);
}
getch();
}
여기서 뭐가 틀릴까~요~
-
차나 2023-07-01
scanf(\%d\
-
황소자리 2023-07-01
아 감사합니다.
-
주인님 2023-07-01
c=3이 아니라 c=0으로 해야 합니다. 굳이 c=3으로 쓰시고 싶으시다면 c=(b%3); 대신에 c=b를 하시거나 비교연산 할 때 b를 바로 쓰시면 됩니다