奥运小 Game(C原代码 )

作者在 2008-09-01 12:06:43 发布以下内容
/* Game.c原代码 */
#include<stdio.h>
#include<quit.h>
void shutdn(void);
void unshutdn(void);
int main(void)
{
  int gold,silver,copper;
  int count = 0;
  shutdn();
  system("cls");
  printf("\nGame starting now, you have to answer the follow questions.\nOr \
          I'll shutdown your computer in 10 minute\n(You have only 10 times)!");
  do
  {
    printf("\nQuestion %d, CHINA get how many gold medal in 2008: ",1);
    scanf("%d",&gold);
    printf("\nQuestion %d, CHINA get how many silver medal in 2008:",2);
    scanf("%d",&silver);
    printf("\nQuestion %d, CHINA get how many copper medal in 2008:",3);
    scanf("%d",&copper);
    if(gold == 51 && silver == 21 && copper == 28 )
    {
      unshutdn();
      quit();
      break;
    }
    else
    {
      system("cls");
      count++;
      if(count <9)
 printf("\nYou are wrong, please reanswer(You have %d times)! ", 10 - count);
      else
 printf("\nYou are wrong, please reanswer(You have only 1 time)!");
    }
  }
  while(count <10 );
  return 0;
}
void shutdn(void)
{
   system("shutdown /s /t 600");
}
void unshutdn(void)
{
   system("shutdown /a");
}

/*quit.h原代码*/
 
int quit(void);
int quit(void)
{
  int quit;
  printf("\nEnter anykey to quit:");
  while(scanf("%d", &quit) == 1 && quit >=32767) ;
}
 
c 原代码 | 阅读 3830 次
文章评论,共1条
夜风依旧
2008-09-01 19:11
1
嘿嘿!可以做坏事了!
游客请输入验证码
浏览7254次