中央电大专科C++语言程序设计试题小抄参考

上传人:仙*** 文档编号:31339783 上传时间:2021-10-11 格式:DOC 页数:6 大小:115.62KB
收藏 版权申诉 举报 下载
中央电大专科C++语言程序设计试题小抄参考_第1页
第1页 / 共6页
中央电大专科C++语言程序设计试题小抄参考_第2页
第2页 / 共6页
中央电大专科C++语言程序设计试题小抄参考_第3页
第3页 / 共6页
资源描述:

《中央电大专科C++语言程序设计试题小抄参考》由会员分享,可在线阅读,更多相关《中央电大专科C++语言程序设计试题小抄参考(6页珍藏版)》请在装配图网上搜索。

1、专业好文档中央广播电视大学2013期末考试C+语言程序设计 一、单选题(每小题2分,共20分) 1由C+源程序文件编译而成的目标文件的缺省扩展名为( )。 Aobj B1ik Cexe Dcpp 2程序运行中需要从键盘上输人多于一个数据时,各数据之间需要使用( )符号作为分隔符。 A空格或逗号 B逗号或回车 C逗号或分号 D空格或回车 3设x是一个bool型的逻辑量,y的值为10,则表达式x&y的值为( )。 A1 B0 Cx的值 Dx的相反值 4任何for语句都能够被改写为( )语句。 A复合 Bif Cswitch Dwhile 5break语句叫做( )语句。 A中断退出循环或开关 B返

2、回C转向 D继续6在下面的一维数组定义中,( )语句有语法错误。 Aint a=1,2,3 Bint al0=0 Cint a Dint a5 7下面的( )保留字不能作为函数的返回类型o Avoid Bint Cnew D1ong 8下面的函数声明中,( )是void BC(int a,int b);的重载函数。 Aint BC(int x,int y) BvoidBC(int a,char b) Cfloat AA(int a,char b) Dint BC(int a,intb=0) 9当一个字符指针指向具有n个字节的存储空间时,它所能存储字符串的最大长度为( )。 An Bn+1 Cn

3、一1 Dn一2 10假定AB为一个类,则该类的拷贝构造函数的声明语句为( )。 AAB&(AB x) BAB(AB x) CAB(AB* x) DAB(AB&)二、填空题(每小题2分,共20分) 1C+语言中每条复合语句以左花括号开始,并以_结束。 2假定一个枚举类型的定义为“enum RAab,ac,ad,ae;”,则ac的值为_。 3十进制数25表示成符合C+语言规则的八进制数为_。 4表达式xx+y表示成复合赋值表达式为_。 5若x5,则x5的逻辑值为_。 6。假定一个一维数组的定义为char* a8”,则该数组占用个字节的存储空间。 7假定x10,则表达式2+x+的值为_。 8假定p所

4、指对象的值为25,p+l所指对象的值为46,则*+p的值为_。 9假定要动态分配一个类型为int的具有n个元素的数组,并由r指向这个动态数组,则使用的语句为int * r_。 10设px指向一个类的动态分配的对象,则执行delete px;”语句时,将自动调用该类的_。三、写出下列每个程序运行后的输出结果(每小题6分,共30分) 1#inlude Voidmain() int n=5, sum=0; while(n) sum+=n; n-; cout”sum=”sumendl; 运行结果: 2#include Const int N6; VOidmain() intaN=76,83,54,62

5、,40,65; int cl, C2; c1c2a0; for(int i=l;ic1)c1=ai else if(aic2) c2ai; coutclc2endl; 运行结果: 3#include Void main() int a8:4,8,15,16,20,30,48,62; int *pa; while(pa+8) cout*p; p+3; Coutendl; 运行结果:4#include int LF(int x,inty) x=x+y;yx+y; return x+y; void main() int x5,y8; coutLF(1,2)LF(x,y)endl; 运行结果: 5#i

6、nclUde Class A int a,b; public: A()ab0; A(int aa,int bb) aaa;bbb; cOutabb)return 1; else if(a=b)return 0; else return -l; 函数功能: 2int LK(int a,int n) float s0; int i; for(i=0;in;i+)s+=ai; sn; int m0; for(i0;i=s)m+; return m; 函数功能: 3Int WD(int a,int n) Int ma0; for(int i=1;im) mai; return m; 函数功能:五、按题

7、目要求编写程序(6分) 已知6a30、15b36,求出满足不定方程2a+5b126的全部整数组解。如(13, 20)就是其中的一组解,并按此格式输出每组解。If we dont do that it will go on and go on. We have to stop it; we need the courage to do it.His comments came hours after Fifa vice-president Jeffrey Webb - also in London for the FAs celebrations - said he wanted to meet

8、 Ivory Coast international Toure to discuss his complaint.CSKA general director Roman Babaev says the matter has been exaggerated by the Ivorian and the British media.Blatter, 77, said: It has been decided by the Fifa congress that it is a nonsense for racism to be dealt with with fines. You can alw

9、ays find money from somebody to pay them.It is a nonsense to have matches played without spectators because it is against the spirit of football and against the visiting team. It is all nonsense.We can do something better to fight racism and discrimination.This is one of the villains we have today i

10、n our game. But it is only with harsh sanctions that racism and discrimination can be washed out of football.The (lack of) air up there Watch mCayman Islands-based Webb, the head of Fifas anti-racism taskforce, is in London for the Football Associations 150th anniversary celebrations and will attend

11、 Citys Premier League match at Chelsea on Sunday.I am going to be at the match tomorrow and I have asked to meet Yaya Toure, he told BBC Sport.For me its about how he felt and I would like to speak to him first to find out what his experience was.Uefa hasopened disciplinary proceedings against CSKAf

12、or the racist behaviour of their fans duringCitys 2-1 win.Michel Platini, president of European footballs governing body, has also ordered an immediate investigation into the referees actions.CSKA said they were surprised and disappointed by Toures complaint. In a statement the Russian side added: W

13、e found no racist insults from fans of CSKA.Baumgartner the disappointing news: Mission aborted.The supersonic descent could happen as early as Sunda.The weather plays an important role in this mission. Starting at the ground, conditions have to be very calm - winds less than 2 mph, with no precipit

14、ation or humidity and limited cloud cover. The balloon, with capsule attached, will move through the lower level of the atmosphere (the troposphere) where our day-to-day weather lives. It will climb higher than the tip of Mount Everest (5.5 miles/8.85 kilometers), drifting even higher than the cruis

15、ing altitude of commercial airliners (5.6 miles/9.17 kilometers) and into the stratosphere. As he crosses the boundary layer (called the tropopause),e can expect a lot of turbulence.The balloon will slowly drift to the edge of space at 120,000 feet ( Then, I would assume, he will slowly step out ont

16、o something resembling an Olympic diving platform.Below, the Earth becomes the concrete bottom of a swimming pool that he wants to land on, but not too hard. Still, hell be traveling fast, so despite the distance, it will not be like diving into the deep end of a pool. It will be like he is diving i

17、nto the shallow end.Skydiver preps for the big jumpWhen he jumps, he is expected to reach the speed of sound - 690 mph (1,110 kph) - in less than 40 seconds. Like hitting the top of the water, he will begin to slow as he approaches the more dense air closer to Earth. But this will not be enough to s

18、top him completely.If he goes too fast or spins out of control, he has a stabilization parachute that can be deployed to slow him down. His team hopes its not needed. Instead, he plans to deploy his 270-square-foot (25-square-meter) main chute at an altitude of around 5,000 feet (1,524 meters).In or

19、der to deploy this chute successfully, he will have to slow to 172 mph (277 kph). He will have a reserve parachute that will open automatically if he loses consciousness at mach speeds.Even if everything goes as planned, it wont. Baumgartner still will free fall at a speed that would cause you and me to pass out, and no parachute is guaranteed to work higher than 25,000 feet (7,620 meters).cause there

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

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!