[求助]请问这个程序怎么调试的时候第二个SCANF执行不了.
各位高手请帮我看一下下面这个程序,怎么调试的时候第二个SCANF执行不了.而且rand()这个函数,每次随机产生的数值第一个一定是41,为什么啊.?
#include<stdio.h>
#include<stdlib.h>
void main(void)
{
char i;char j;
int m,n;
m=rand()%100;
printf("*********************\n*WELCOME TO THE GAME*\n*********************\n");
printf("do you want to play this game?(Y/N)\n");
scanf("%c",&j);
if(j=='y'||j=='Y')
{
printf("do you want to see the help file?(Y/N)\n");
scanf("%c",&i);
if(i=='y'&&i=='Y')
{printf("***The computer will randomly produce a number between 0-100 that you won't know.");
printf("Your job is following the prompt and finding out the wright number***.\n");
}
else
printf("LET'S GO!\n");
while((m-1)!=0)
{
printf("Now plesase input the number you guess:\n");
scanf("%d",&n);
if(n==m)
{printf("YEAH!That's right!\n");
break;}
else if(n<m)
{printf("The number you put in is too small,please try again:\n");
continue;}
else if(n>m)
{printf("The number you put in is too big,please try again:\n");
continue;}
}
system("pause");
}
else
printf("thanks,see you later!");
}
执行情况如下图所示:
请高手指点程序哪里有问题,谢谢了..