#include <cstdlib>
#include <iostream>
#include <ctime>
using namespace std;
int main()
{
int x=100,y=100,sx,sy,k;
srand(time(0));
x=y=10;
while(1){
k++;
x=10+k;
sx=rand()%x+1;
sy=rand()%y+1;
for(int i=1;i<=x;i++)
{
for(int m=1;m<=y;m++)
if(m==sy&& i==sx)
cout<<" ,";
else
cout<<" .";
cout<<" "<<i<<endl;
}
for(int i=1;i<=x;i++)
{
if(i>9)
cout<<i;
else
cout<<" "<<i;
}
cout<<endl;
int x1,y1;
cin>>x1>>y1;
if(x1==sx && y1==sy)cout<<"Good!\n";
else {cout<<"Bad!\n"<<sx<<‘ ‘<<sy<<endl;return 0;}
}
return 0;
}
时间: 2024-10-28 22:21:54