[求助]各位大哥来帮忙看看我这哪写错了。
main(){
int Password,i=0;
printf("=======This is a Number Guess Game!!=====\n\n");
printf("Please input your password!\n");
scanf("%d",&Password);
while(Password!=1986)
{
i++;
if(i==3)
{
printf("Sorry,you are three times wrong!");
return;
}
printf("Please input the corret password!!\n");
scanf("%d",&Password);
}
clrscr();
{
char c;
printf("Pass.Do you want to start?\n\n\nStart press Y else N.\n\n");
c=getchar();
if(c='Y'||'y')
printf("Game start!");
else
if(c='N'||'n')
printf("Press any key to quit....");
else
if(c!='Y'||'N'||'y'||'n')
printf("Please press Y or N!!");
return;
}
}
第2段程序想由键盘输入 Y或者N来输出提示的,但执行出来却是直接出现GAME START了
[此贴子已经被作者于2005-11-3 21:24:05编辑过]