2014年3月全国计算机二级C语言上机模拟试题二十五

2014-11-03 13:45:07 · 作者: · 浏览: 30

  注意:源程序存放在考生文件夹下的BLANK1.C中。


  不得增行或删行,也不得更改程序的结构!


  给定源程序:


  #include


  #include


  #define N 8


  typedef struct


  { char num[10];


  int year,month,day ;


  }STU;


  ___1___ fun(STU *std, char *num)


  { int i; STU a={"",9999,99,99};


  for (i=0; i   if( strcmp(___2___,num)==0 )


  return (___3___);


  return a;


  }


  main()


  { STU std[N]={ {"111111",1984,2,15},{"222222",1983,9,21},{"333333",1984,9,1},


  {"444444",1983,7,15},{"555555",1984,9,28},{"666666",1983,11,15},


  {"777777",1983,6,22},{"888888",1984,8,19}};


  STU p; char n[10]="666666";


  p=fun(std,n);


  if(p.num[0]==0)


  printf("\nNot found !\n");


  else


  { printf("\nSucceed !\n ");


  printf("%s %d-%d-%d\n",p.num,p.year,p.month,p.day);


  }


  }