C程序设计综合练习题读程序写结果题.docVIP

  • 12
  • 0
  • 约9.13千字
  • 约 14页
  • 2023-04-01 发布于山东
  • 举报

C程序设计综合练习题读程序写结果题.doc

C++程序设计模拟试题 三、用C++语言描述以下命题 1、A小于B并且A大于C 2、A和B中有—个小于C 3、A是奇数 4、B和C中较大者与A相等 5、年份Y是闰年 四、写出以下程序的执行结果 #includeiostreamvoidmain( ){  .h intb[3][5]={11,12,13,14,15,21,22,23,24,25,31,32,33,34,35}; int(*p)[5]; p=b; for(intj=0;j5;j++) cout*(*p+j),; coutendl; } #includeiostream.h voidswapl(inta,intb) { inttemp=a; a=b; b=temp; } voidswap2(int*a,int*b) { inttemp=*a; *a=*b,*b=temp; } voidswap3(int*a,int*b) { int*temp=a; a=b,b=temp; } voidswap4(inta,intb) { inttemp=a; a=b;b=temp; } voidmain( ) { inta=10,b=20; swapl(a,b); couta:bendl; swap2(a,b); couta:bendl; swap3(a,b); couta:bendl; swap4(a,b); couta:bendl

文档评论(0)

1亿VIP精品文档

相关文档