C语言结构体实现学生信息统计.docxVIP

  • 19
  • 0
  • 约1.87千字
  • 约 4页
  • 2020-01-20 发布于广东
  • 举报
C语言程序设计作业6 粱英华 200913201054 一.6.1和6.2放在一个程序里实现。 1 ?思路: 通过结构体和for()来实现学生数据的输入输出,即学号,名字, 年龄和性别,并对相关选项判别。 2 ?源程序: #includestdio.h #i ncIude〈str i ng? h #define TIME n0%d\t%s\t%d\t%c\nH /*自定义学生输入的格式*/ #def ine KAKA Num\tName\tAge\tGender\n /*自定义输岀的格式*/ #def ine MILITO nBoy\tGi r I\tAge18\nn /*自定义统计的输岀格式*/ struet student { irrt num; char name[10]; int age; char sex; }; /*结构体声明学生统计要素*/ ma i n () { void input (struet student stu[]); void count (struet student stu[]); struet student stu[4]; i nt i, j, boy二0, gir l=0, c二0; /*初始化*/ i nput (stu); input*/ for (j=0;j1;j++) /*调用学生的输入函数 printf (KAKA); /*调用自

文档评论(0)

1亿VIP精品文档

相关文档