C语言复习要点.ppt_第1页
C语言复习要点.ppt_第2页
C语言复习要点.ppt_第3页
C语言复习要点.ppt_第4页
C语言复习要点.ppt_第5页
已阅读5页,还剩13页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

复习要点 考试题型教材例题 每章小结 课后习题 课件内容上机实验程序 1 练习 2 填空 1 break语句不能用于循环语句和 语句之外的任何其他语句中 2 72 在内存中占 个字节 3 Switch1 3 下面的程序段的输出结果是 inta 023 printf d n a 4 设ch为char型变量 其值是A 则以下的表达式的值是 ch ch A ch Z ch 32 ch 4 3 184 a 5 以下printf语句的输出结果是 printf d n strlen school 6 每个c语言程序必须有一个 函数 5 5 66 主 main 7 inta 1 2 3 4 5 6 7 8 9 10 填可以或不可以 用a 来表示数组元素地址 8 charstr 20 str IloveChina 上面的程序段 填正确或错误 6 7 不可以8 错误 读程序写结果 运行结果 i 15ch1 A 1 基本输出格式顺序结构 include stdio h voidmain charch1 A printf i d n 10 2 5 printf ch1 c n ch1 7 2 includevoidmain charch1 A inta 0 b 1 if a b printf i d n 10 2 5 elseprintf ch1 c n ch1 8 运行结果 ch1 A 运行结果 3 3 includevoidmain charc string 81 Howareyou inti n 0 flag 0 for i 0 c string i 0 i if c flag 0 elseif 0 flag flag 1 n printf d n n 9 运行结果 ABC 4 includevoidmain floatscore score 100 if score 60 printf E n elseswitch int score 10 case6 printf D n break case10 case9 printf A n case8 printf B n case7 printf C n break default printf error n 10 运行结果 average 10 5scores average 1514131211 5 一维数组和for循环结构 include stdio h voidmain inti s 10 floata 0 0 for i 0 iaverage n for i 0 ia printf 4d s i 11 运行结果 thedatais 4321 6 二维数组和while do while 循环结构 includevoidmain intnumber digit printf thedatais number 1234 do digit number 10 printf d digit number number 10 while number 0 12 运行结果 a Iamateacher a Youareastudent 7 includevoidmystrcpy chars1 chars2 voidmain chara 50 Iamateacher charb Youareastudent printf a s n a mystrcpy a b printf a s n a voidmystrcpy chars1 chars2 inti 0 while s2 i 0 s1 i s2 i s1 i 0 13 运行结果 a 3b 5m 24 8 函数 考点是形参和实参的数据传输 includeintchange intx inty voidmain inta b m a 3 b 5 m change a b printf a db dm d a b m intchange intx inty x y returnx y 14 运行结果 the61day voidmain intdays 0 i intmon day 12 31 28 31 30 31 30 31 31 30 31 30 31 date year 2004 date month 3 date day 2 for i 1 i 3 days days 1 printf the dday n days 9 结构体 includestructdate type intyear month day date 15 程序填空题1 以下程序的功能 从键盘输入若干个学生的成绩 统计并输出最高成绩和最低成绩 当输入为负数时 结束输入 结果 1 x 0 2 amax x 3 x amin 4 amax 5 amin includevoidmain floatx amax amin scanf f printf namax f namin f 4 5 16 2 以下程序的功能 从键盘输入10个学生的成绩 由高到低排序输出成绩 结果 6 10 a j t includevoidmain inta 11 i j t for i 1 i 10 i scanf d for i 1 i 9 i for j j 10 j if a i a i a j printf Thesortedscores n for i 1 i 10 i printf 4d a i 17 3 在一定数值范围 6 10000 内验证命题 任一个偶数可以分解为两个素数之和 结果 11 x 2 12 x i 0 13 n 2 14 i n 2 15 includeintprime intx inti for i 2

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论