当前所在位置:珠峰网资料 >> 计算机 >> 计算机等级考试 >> 正文
2015年计算机二级C语言50套程序填空上机题(6)
发布时间:2011/11/1 9:29:04 来源:城市学习网 编辑:ziteng

  6、程序通过定义并赋初值的方式,利用结构体变量存储了一名学生的信息。函数fun的功能是输出这位学生的信息。

  请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。

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

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

  #include     

  typedef  struct

  {  int  num;

     char  name[9];

     char  sex;

     struct { int  year,month,day ;} birthday;

     float  score[3];

  }STU;

  /**********found**********/

  void show(STU  ___1___)

  {  int  i;

     printf("\n%d %s %c %d-%d-%d", tt.num, tt.name, tt.sex,

               tt.birthday.year, tt.birthday.month, tt.birthday.day);

    for(i=0; i<3; i++)

  /**********found**********/

       printf("%5.1f", ___2___);

    printf("\n");

  }

  main( )

  {  STU  std={ 1,"Zhanghua",’M’,1961,10,8,76.5,78.0,82.0 };

     printf("\nA student data:\n");

  /**********found**********/

     show(___3___);

  }

广告合作:400-664-0084 全国热线:400-664-0084
Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号
珠峰网 版权所有 All Rights Reserved