Game of Nim with removal of one stone allowed | C ++ program for Game of Nim with removal of one stone allowed . ; Return true if player A wins , return false if player B wins . ; Checking the last bit of N . ; Driven Program
#include <bits/stdc++.h> NEW_LINE using namespace std ; bool findWinner ( int N ) { return N & 1 ; } int main ( ) { int N = 15 ; findWinner ( N ) ? ( cout << " Player ▁ A " ; ) : ( cout << " Player ▁ B " ; ) ; return 0 ; }