You are on page 1of 3

,


(impartial) (partial)


/

{,,}

-
-
-
------------------

{,,}

{,,}
-
-
-
------------------

{,,}

{,,}

? {,,}

{,,}

,


(wining position)

(losing position)
(losing position )

(wining position )

losing position losing position


( )

( , )

-
-
-
-------------------

,,

XOR


a,b,c,d


XOR

code source
1.

int main()

2.

3.

int i,j,n,XOR;

4.

cout <<"Enter number of piles : ";

5.

cin>>n;

6.

XOR=0;

7.

for(i=1;i<=n;i++)

8.

9.

cout<<"Enter number of stones in pile "<<i<<": ";

10.

cin>>j;

11.

XOR=XOR^j;

12.

13.

if(XOR)

14.

cout<<"\nThe game is nonstrategic";

15.

else

16.

cout<<"\nThe game is strategic";

17.
18.

return 0;
}


wining position


losing position


All Izz Well :)...
wining position :)

-

losing position

You might also like