北京大学《计算概论》课件:第10讲-复合数据结构-数组与结构资料教程.pptxVIP

  • 2
  • 0
  • 约4.17千字
  • 约 74页
  • 2018-11-29 发布于天津
  • 举报

北京大学《计算概论》课件:第10讲-复合数据结构-数组与结构资料教程.pptx

北京大学《计算概论》课件:第10讲-复合数据结构-数组与结构资料教程.pptx

第十讲:复合数据结构 ——数组与结构;数组 是 什么?;如何声明 一个数组;数组 中 变量 的 编号;如何访问 数组 中 的 变量;数组变量赋值 的 一种特殊方式;#include stdio.h int main(){ int sz[10]; int i; for( ; ; ){ ; } for(i = 0; i 10; i++){ printf(%d , sz[i]); } return 0; };#include stdio.h int main(){ int sz[10]; int i; for( i=0 ; i 10 ; i++){ scanf(%d, (sz[i])); } for(i = 0; i 10; i++){ printf(%d , sz[i]); } return 0; };数组 的 遍历;正向 遍历;反向 遍历;通过遍历 实现 对 数组变量 的 控制台赋值;通过遍历 实现 对 数组变量 的 控制台输出;数组 的 应用示例;游戏:过年抽奖;编程的基本思路;#define LUCKY_M 2345 //财政盈余 #define POPULATION 128 //村民数量 int main( ){ int pe

文档评论(0)

1亿VIP精品文档

相关文档