浙江师范大学2012年夏C语言参考答案.docVIP

  • 38
  • 0
  • 约7.26千字
  • 约 9页
  • 2016-08-03 发布于重庆
  • 举报
浙江师范大学2012年夏C语言参考答案

浙江师范大学《计算机应用(理)—C语言程序设计》考试卷 (2011—2012学年第二学期) 考试类别: 闭卷 使用学生: 公共课理科各专业学生 考试时间: 120 分钟 出卷时间: 2012 年 5 月 15 日 说明:考生应将全部答案标清题号写在答题纸上,否则作无效处理。 程序填空题(每小空2分,共32分) 试题1、以下程序的功能是:从键盘上输入若干学生的成绩,统计并输出最高成绩和最低成绩,当输入负数时结束输入。 #includestdio.h void main () { float x, amax, amin; scanf(“%f”, x); amax=x; amin=x; while( x=0 ) { if ( xamax ) amax=x ; else if (xamin) amin=x ; scanf(%f, x) ; } printf(“\namax=%f\namin=%f\n”, amax, amin); } 试题2、从键盘输入一批以 -1结束的整数,将其中的奇数以”%3d”的格式写入当前目录下的文本文件res.txt。 #include stdio.h #include stdlib.h void main() { int x;

文档评论(0)

1亿VIP精品文档

相关文档