Code: Select all
int cheque[300] = {0};
Code: Select all
for(i = 0; i < game; i++)
{
if(cheque[i] == 0) printf("Game #%i: no king is in check.", i + 1);
if(cheque[i] == 1) printf("Game #%i: white king is in check.", i + 1);
if(cheque[i] == 2) printf("Game #%i: black king is in check.", i + 1);
printf("\n");
}
According to problem description its invalid input/outputbrianfry713 wrote:Input:AC output:Code: Select all
PbprNPqR BNRKbQ.n p.qBpbrp .N..R.NR QRqn.R.b Pp.bQRrq rnnRrrBk BRbbbNrQ ........ ........ ........ ........ ........ ........ ........ ........
Code: Select all
Game #1: both kings are in check.
There will be no invalid characters (i.e. pieces) and there won't be a configuration where both kings are in check.