中国高校课件下载中心 》 教学资源 》 大学文库

上海交通大学:《C++程序设计》课程教学课件(PPT讲稿)第五章 数组

文档信息
资源类别:文库
文档格式:PPT
文档页数:10
文件大小:214.5KB
团购合买:点击进入团购
内容简介
一、通过本章学习,你能够 二、理解何谓数组 三、 定义和使用数组 四、用数组处理字符串 五、理解基本的排序、查找算法
刷新页面文档预览

成绩排序问题 ■按学号顺序从键盘输入某班某课程 成绩,要求从低到高顺序输出成绩

1 成绩排序问题 ◼ 按学号顺序从键盘输入某班某课程 成绩,要求从低到高顺序输出成绩

分析(设该班人数为2人) int score1, score2, if(score1 score2) swap(score1, score 2); cout<< score1<< score2 <<end

2 分析(设该班人数为2人) int score1, score2; ... if(score1 > score2) swap(score1, score2); cout<< score1 << score2 <<endl;

案例分析(设该班人数为3人) int score1, score2 scorer if(score 1>score2) swap(score1, score2); if(score 2>score3) swap(score2 score) if(score1>score2) swap(score1, score2); cout< <score1<<score2<<scores<<end

3 案例分析(设该班人数为3人) int score1, score2, score3; ... if(score1>score2) swap(score1, score2); if(score2>score3) swap(score2, score3); if(score1>score2) swap(score1, score2); cout<<score1<<score2<<score3<<endl;

案例分析(设该班人数为4人) int score1, score2, score3, score4i cin>>score1>>score2>>score3>>score4i cout<<score l<<score2<<score3<<score

4 案例分析(设该班人数为4人) int score1, score2, score3, score4; cin>>score1>>score2>>score3>>score4; ???? cout<<score1<<score2<<score3<<score4;

案例分析(设该班人数为30人) int maino ???

5 案例分析(设该班人数为30人) int main() { ???? }

程序设计基础(C++) 第5章数组

程序设计基础(C++) 第5章 数组

目标 通过本章学习,你能够 n理解何谓数组 定义和使用数组 用数组处理字符串 理解基本的排序、查找算法

7 目标 ◼ 通过本章学习,你能够 ◼ 理解何谓数组 ◼ 定义和使用数组 ◼ 用数组处理字符串 ◼ 理解基本的排序、查找算法

主要内容 何谓数组 数组的定义 数组的使用 在数组中查找数据 多维数组 数组与字符串 ■本章作业

8 主要内容 ◼ 何谓数组 ◼ 数组的定义 ◼ 数组的使用 ◼ 在数组中查找数据 ◼ 多维数组 ◼ 数组与字符串 ◼ 本章作业

本章小结 何谓数组 定义数组 使用数组 排序算法 查找算法 多维数组 ■字符串与数组 注意:控制数组下标的上下界是程序员的职责! 47n

47 本章小结 ◼ 何谓数组 ◼ 定义数组 ◼ 使用数组 ◼ 排序算法 ◼ 查找算法 ◼ 多维数组 ◼ 字符串与数组 注意:控制数组下标的上下界是程序员的职责!

本章作业 m实验5 ■复习第5章,预习第6章 ■1~9,11,13,15

48 本章作业 ◼ 实验5 ◼ 复习第5章,预习第6章 ◼ 1~9,11,13,15

已到末页,全文结束
刷新页面下载完整文档
VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
相关文档