程序测试程序(配合游戏及学习控制管理器使用)

文章作者 100test 发表时间 2007:09:06 13:15:35
来源 100Test.Com百考试题网


  配合游戏控制,学习控制,通过测试可以获得游戏点数

  /*test.ini(可自行添加修改试题,根据注释中的格式增加即可)*/


.==================================================================
.==================================================================
  记录方式:注释→ “.”后
  测试文件夹
  D:\TEST\
  总测试数
  2
  .测试记录
  .格式:
  .原题
  .标准输出数据
  请计算:已知:Q=1*2*3*4*5*6*7*8*9*10,P=1 2 3 4 5 6 7 8 9 10,M=Q/P,SUM=Q P M,请输出SUM.
  3694833
  请计算:(90 91 92.... 99 100)*52.8 PI MAX,并输出结果.
  10055179.140000
.==================================================================

  /*test 记录试题是否通过的情况*/

  1 1

  /*test.c 主程序,请用gcc编译(例如DEV-CPP环境下)*/
  #include
  #include
  typedef struct
  {
   char describe[1000].
   char answer[100].
  } DATA.
  DATA s[20].
  char path[100].
  int testnum.
  char s_p[20].
  char password[20].
  int points.
  int copy(char *infile,char *outfile)
  {
   FILE *input,*output.
   char temp.
   if(strcmp(infile,outfile)!=0 &.&. ((input=fopen(infile,"rb"))!=NULL) &.&. ((output=fopen(outfile,"wb"))!=NULL))
   {
   while(!feof(input))
   {
   fread(&.temp,1,1,input).
   fwrite(&.temp,1,1,output).
   }
   fclose(input).
   fclose(output).
   return 0.
   }
   else return 1.
  }
  int inittest()
  {
   FILE *input,*output.
   int i.
   char temp[80].
   input=fopen("test.ini","r").
   output=fopen("test.tmp","w").
   while(!feof(input))
   {
   fgets(temp,80,input).
   if(temp[0]!=.) fputs(temp,output).
   }
   fclose(input).
   fclose(output).
   input=fopen("test.tmp","r").
   fscanf(input,"%s",path).
   fscanf(input,"%d",&.testnum).
   for(i=0.i    fclose(input).
   input=fopen("test","r").
   for(i=0.i    fclose(input).
  }


相关文章


游戏及学习控制管理器
程序测试程序(配合游戏及学习控制管理器使用)
三言两语,妙说《指针》。
2007年计算机等级考试二级C语言考试真题
澳大利亚华人论坛
考好网
日本华人论坛
华人移民留学论坛
英国华人论坛