C语言学习教程:搬山游戏开发源码
#include<stdio.h>
void main()
{
int n,k,x,y,cc,pc,g;
clrscr();
puts("*******************************************************");
puts("* This is a Mountain Moveing Game. *");
puts("* There are n mountains, two persons move them in *");
puts("* turn. Each one each time moves 1 to k mountains, the*");
puts("* one who takes the last stick will lose the game. *");
puts("*******************************************************");
printf(" >> --------------- Game Begin ---------------------\n");
pc=cc=0;
g=1;
for(;;)
{
printf(" >> No.%2d game \n",g++);
printf(" >> ---------------------------------------\n");
printf(" >> How many mountains are there? ");
scanf("%d",&n);
if(!n) break;
printf("