欢迎来到天天文库
浏览记录
ID:59279316
大小:70.00 KB
页数:16页
时间:2020-09-07
《c++程序设计综合练习题-读程序写结果题.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、..C++程序设计模拟题三、用C++语言描述下列命题1、A小于B并且A大于C2、A和B中有—个小于C3、A是奇数4、B和C中较大者与A相等5、年份Y是闰年四、写出下列程序的执行结果1.#includevoidmain(){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;j<5;j++)cout<<*(*p+j)<<",";cout<voidsw
2、apl(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(int&a,int&b)a..{inttemp=a;a=b;b=temp;}voidmain(){inta=10,b=20;swapl(a,b);cout<3、ap3(&a,&b);cout<voidprint(intw){inti;if(w!=0){print(w-1);for(i=1;i<=w;i++)cout<#definesw(x,y){x^=y;y^=x;x^=y;}voidmain(){inta=10,b=01;sw(a,4、b);cout<voidmain(){inta,b,c,x;a=b=c=0;for(intk=0;k<10;k++){cin>>x;switch(x%3){case0:a+=x;break;case1:b+=x;break;case2:c+=x;break;}}cout<5、m.h>voidmain(){intj,k;for(j=5;j>0;j--){for(k=j;k>0;k--)cout<<"*";cout<voidmain(){intnNumber;int*pPointer;nNumber=15;pPointer=&nNumber;cout<<"nNumberisequalto:"<6、iostream.h>int*pPointer;voidSomeFunction(){pPointer=newint;*pPointer=25;}voidmain(){SomeFunction();cout<<"Valueof*pPointer:"<<*pPointer<voidAddFive(int*Number){*Number=*Number+5;}voidmain(){intnMyNumber=18;cout<<"Myoriginalnumberi7、s"<voidmain(){intArray[3];a..Array[0]=10;Array[1]=20;Array[2]=30;int*pArray;pArray=&Array[0];cout<<"pArraypointstothevalue."<8、}1.***#includeinti=4;voidmain(){cout<<"i="<
3、ap3(&a,&b);cout<voidprint(intw){inti;if(w!=0){print(w-1);for(i=1;i<=w;i++)cout<#definesw(x,y){x^=y;y^=x;x^=y;}voidmain(){inta=10,b=01;sw(a,
4、b);cout<voidmain(){inta,b,c,x;a=b=c=0;for(intk=0;k<10;k++){cin>>x;switch(x%3){case0:a+=x;break;case1:b+=x;break;case2:c+=x;break;}}cout<5、m.h>voidmain(){intj,k;for(j=5;j>0;j--){for(k=j;k>0;k--)cout<<"*";cout<voidmain(){intnNumber;int*pPointer;nNumber=15;pPointer=&nNumber;cout<<"nNumberisequalto:"<6、iostream.h>int*pPointer;voidSomeFunction(){pPointer=newint;*pPointer=25;}voidmain(){SomeFunction();cout<<"Valueof*pPointer:"<<*pPointer<voidAddFive(int*Number){*Number=*Number+5;}voidmain(){intnMyNumber=18;cout<<"Myoriginalnumberi7、s"<voidmain(){intArray[3];a..Array[0]=10;Array[1]=20;Array[2]=30;int*pArray;pArray=&Array[0];cout<<"pArraypointstothevalue."<8、}1.***#includeinti=4;voidmain(){cout<<"i="<
5、m.h>voidmain(){intj,k;for(j=5;j>0;j--){for(k=j;k>0;k--)cout<<"*";cout<voidmain(){intnNumber;int*pPointer;nNumber=15;pPointer=&nNumber;cout<<"nNumberisequalto:"<6、iostream.h>int*pPointer;voidSomeFunction(){pPointer=newint;*pPointer=25;}voidmain(){SomeFunction();cout<<"Valueof*pPointer:"<<*pPointer<voidAddFive(int*Number){*Number=*Number+5;}voidmain(){intnMyNumber=18;cout<<"Myoriginalnumberi7、s"<voidmain(){intArray[3];a..Array[0]=10;Array[1]=20;Array[2]=30;int*pArray;pArray=&Array[0];cout<<"pArraypointstothevalue."<8、}1.***#includeinti=4;voidmain(){cout<<"i="<
6、iostream.h>int*pPointer;voidSomeFunction(){pPointer=newint;*pPointer=25;}voidmain(){SomeFunction();cout<<"Valueof*pPointer:"<<*pPointer<voidAddFive(int*Number){*Number=*Number+5;}voidmain(){intnMyNumber=18;cout<<"Myoriginalnumberi
7、s"<voidmain(){intArray[3];a..Array[0]=10;Array[1]=20;Array[2]=30;int*pArray;pArray=&Array[0];cout<<"pArraypointstothevalue."<8、}1.***#includeinti=4;voidmain(){cout<<"i="<
8、}1.***#includeinti=4;voidmain(){cout<<"i="<
此文档下载收益归作者所有