Find the player who wins the game by removing the last of given N cards | C ++ Program to implement the above approach ; Function to check which player can win the game ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; void checkWinner ( int N , int K ) { if ( N % ( K + 1 ) ) { cout << " A " ; } else { cout << " B " ; } } int main ( ) { int N = 50 ; int K = 10 ; checkWinner ( N , K ) ; }