U E D R , A S I H C RSS

랜웍/이진훈

using namespace std;

const int Arsize = 3;
int pan33 = {
{0,0,0},
{0,0,0},
{0,0,0}
};

int count = 1;

int countz();


void main()
{
srand(time(0));
int x = rand()%3;
int y = rand()%3;
int a = 0 , b = 0;
int z = countz();
while(z)
{
x = x+a;
y = y+b;
panxy = 1;
do
{
a = rand()%3 - 1;
b = rand()%3 - 1;
if (a == 0 && b == 0)
continue;
else if ((x+a >= 0 && x+a < 3) && (y+b >= 0 && y+b < 3))
break;
}while(true);
count++;
z = countz();
}
for (int i = 0;i<3;i++)//출력부..
{
for (int k = 0;k<3;k++)
cout << panik;
cout << endl;
}
}

int countz()//빈칸없나 체크하는 함수.
{
int k = 0;
for (int i = 0;i<3;i++)
for(int j = 0;j<3;j++)
{
if (panij == 0)
k++;
}
return k;
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:21
Processing time 0.0257 sec