#include<stdio.h>
int main(void)
{
int totalCoin,getCoin,player[2]={0,0},idx;
do{
if(totalCoin%2 == 1)
break;
}while(1);
for(idx=0;totalCoin > 0;idx = (idx == 0) ? 1:0){
printf("残りコイン枚数:%d\n",totalCoin
); printf("先行コイン枚数:%d\n",player
[0]); printf("後行コイン枚数:%d\n",player
[1]);
do{
if(idx == 0)
printf("先行のプレイヤーはコインを取ってください(1~4枚):"); else
printf("後攻のプレイヤーはコインを取ってください(1~4枚):"); if(getCoin >= 1 && getCoin <= 4 && getCoin <= totalCoin)
break;
}while(1);
totalCoin -= getCoin;
player[idx] += getCoin;
}
printf("先行コイン枚数:%d\n",player
[0]); printf("後行コイン枚数:%d\n",player
[1]); if(player[0] %2 == 0)
else
}
I2luY2x1ZGU8c3RkaW8uaD4KaW50IG1haW4odm9pZCkKewogICAgaW50IHRvdGFsQ29pbixnZXRDb2luLHBsYXllclsyXT17MCwwfSxpZHg7CgkKCWRvewoJCXByaW50Zigi44Kz44Kk44Oz44Gu5p6a5pWw44KS5aWH5pWw44Gn5YWl5YqbOiIpOwoJCXNjYW5mKCIlZCIsJnRvdGFsQ29pbik7CgkJaWYodG90YWxDb2luJTIgPT0gMSkKCQkJYnJlYWs7CgkJcHJpbnRmKCLlpYfmlbDjgaflhaXlipvjgZfjgabjgY/jgaDjgZXjgYRcbiIpOwoJfXdoaWxlKDEpOwoJCglmb3IoaWR4PTA7dG90YWxDb2luID4gMDtpZHggPSAoaWR4ID09IDApID8gMTowKXsKCQlwcmludGYoIuaui+OCiuOCs+OCpOODs+aemuaVsDolZFxuIix0b3RhbENvaW4pOwoJCXByaW50Zigi5YWI6KGM44Kz44Kk44Oz5p6a5pWwOiVkXG4iLHBsYXllclswXSk7CgkJcHJpbnRmKCLlvozooYzjgrPjgqTjg7PmnprmlbA6JWRcbiIscGxheWVyWzFdKTsKCQkKCQlkb3sKCQkJaWYoaWR4ID09IDApCgkJCQlwcmludGYoIuWFiOihjOOBruODl+ODrOOCpOODpOODvOOB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