编程问题求解!!!!!!!!!

大佬们帮帮忙,刚学c没多久,这就是个猜数字程序,我想在结束后询问“是否想在玩”然后决定程序是否继续,但是它直接就开始第二轮了。。。

img

#include<stdio.h>
#include<time.h>
#include<stdlib.h>
int main(void)
{
while(1)
{
int x=1;
char y;
char n;
char choice=y;
int number;
srand(time(0));
number=rand()&10;
int inputnum=-1;
int times=0;
printf("can you guess the right number?pls enter one number!but remember you only have 4 opportunities!\n");
for(times=0;times<5;times++)
{scanf("%d",&inputnum);
if(inputnum>number)
{
printf("too big\n");
}
else if(inputnum<number)
{
printf("too small\n");
}
if(inputnum==number)
{
printf("you are right!you have guessed %d times!\n",times);
x=0;
break;
}
}
if(times<=5!=1)
{
printf("you failed!\n");
x=0;
}
printf("want to play it again?answer y or n\n");
scanf("%c",&choice);
if(choice==n)
{printf("thanks for your playing!");
break;
}
}
}

不知道你这个问题是否已经解决, 如果还没有解决的话:

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^