C语言教程第8章 结构体(精品·公开课件).pptVIP

  • 0
  • 0
  • 约1.25万字
  • 约 65页
  • 2018-11-05 发布于广西
  • 举报

C语言教程第8章 结构体(精品·公开课件).ppt

Functions and Program Structure 第8章 结构体 思考一个问题 在程序里表示一个人的信息(姓名、年龄、性别、……),怎么表示? 表示多个人呢? 如何用计算机程序实现下述表格的管理? 数组的解决方法 int studentId[30]; /* 最多可以管理30个学生, 每个学生的学号用数组的下标表示*/ char studentName[30][10]; char studentSex[30][2]; int timeOfEnter[30]; /*入学时间用int表示*/ int scoreComputer[30];/*计算机原理课的成绩*/ int scoreEnglish[30]; /*英语课的成绩*/ int scoreMath[30]; /*数学课的成绩*/ int scoreMusic[30]; /*音乐课的成绩*/ 数组的解决方法 int studentId[30] = {1,2,3,4,5,6}; char studentName[30][10] = {{令狐冲},{林平之}, {岳灵珊},{任莹莹}}; char studentSex[30][2] = {{男},{男},{女},{女}}; int timeOfEnter[30] = {199

文档评论(0)

1亿VIP精品文档

相关文档