帮我看看这个程序哪有问题

来源:百度知道 编辑:UC知道 时间:2024/06/14 20:03:05
#include <iostream.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>

int number;
int number1;

void ax()
{

cin>>number;
if (number==number1)
{
int c,y=1;
cout<<"回答正确"<<endl;
cout<<"如果还想玩一次,请按y"<<endl;
cin>>c;
c=1;
if (c==y)
{
srand(time(0));
number1=rand()%1000+1;
ax();
}
}
else
{

if (number>number1)
{
cout<<"太大了"<<endl;

ax();
}
else
{
cout<<"太小了"<<endl;
ax();
}
}

}

int bx()
{
srand(time(0));
number1=rand()%1000+1;
return number1;
}

int main()
{

cout<<"有一个数字在1--1000之

#include <iostream.h>
#include <stdlib.h>
#include <time.h>
#include <conio.h>
#include <string.h>

int number;
int number1;

void ax()
{

cin>>number;
if (number==number1)
{
char mark='y';
cout<<"回答正确"<<endl;
cout<<"如果还想玩一次,请按y"<<endl;
mark=getch();

if (mark=='y')
{
cout<<"请输入您要猜的数字:"<<endl;
srand(time(0));
number1=rand()%1000+1;
ax();
}
}
else
{

if (number>number1)
{
cout<<"太大了"<<endl;

ax();
}
else
{
cout<<"太小了"<<endl;
ax();
}
}

}

int bx()
{
srand(time(0));
number1=rand()%1000+