C++程序设计习题与实验教程参考答案(习题部分).docVIP

  • 55
  • 0
  • 约3万字
  • 约 43页
  • 2016-11-23 发布于湖北
  • 举报

C++程序设计习题与实验教程参考答案(习题部分).doc

第章选择题 填空题 2.# includeiostream.h 或 # include”iostream.h” 3.①编译 ②连接(构件) 4.5..编程题 #includeiostream.h void main() { cout我的姓名是XX,’\n’”我的学号为XXX”endl; } 第章选择题 题号 答案 题号 答案 填空题 2..math.h 4.?: 12.4 ②5 勘误: a和b的值分别为 ① 、 ② 。 13.①20 ②32 ③32 ④16 ⑤20 14. 15.①3 ②1 16.9.0 17.13 18.4 三、编程题 #includeiostream.h void main() { int x,y,t; cinxy; coutx’\t’yendl; t=x;x=y;y=t; cout 交换后的两个数为: x’\t’yendl; } #include iostream.h #include math.h void main (void) { int a,b,c; double s,area; cout 输入三角形三边长a,b,c:endl; cinabc; s=(a+b+c)/2.0 ; area=sqrt(s*(s-a)*(s-b)*(s-c)); cout三角形面积为

文档评论(0)

1亿VIP精品文档

相关文档