下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、专业好文档广播电视大学c+语言程序设计期末考试试题2001年元月一、填空(每空2分,共20分)1 c+目标程序经_连接_后生成扩展名为exe的可执行程序文件。2 16位计算机中整型占_2_个字节存储空间。3 要在屏幕上显示hello,world!应执行语句cout=0|x=0) coutabcd;else coutwxyz;屏幕上显示的是abcd 。7 设一维整型数组data已进行了初始化,则其元素个数可由操作符sizeof通过表达式sizeof(data/data0)_计算出来。8 若一全局变量只允许本程序文件中的函数使用,则定义它时应加上修饰符_static。9 设有int w34;,pw
2、是与数组名w等价的数组指针,则pw应初始化为_ int (* pw)4=w。10.要使引用pr代表变量char * p;,则pr应初始化为char * &pr=p。二、单项选择题(每空2分,共20分)1下列变量名中,(a )是合法的。a china b byte-size c double d a+a2下列各种函数中,(c )不是类的成员函数。 a 构造函数 b 析构函数 c 友元函数 d 拷贝构造函数3下列( a )是正确的语句。 a ; b a=17 c x+y d coutn4循环while(int i=0) i-;执行次数是( a )。 a 0 b 1 c 5 d 无限5设int f(
3、int);和int g(int);是函数f和g的原形,以下将f作为语句调用的是( b )。a g(f(3);b f(g(3); c g(f(3)+2); d p= f(g(3)1);6设int * p2=&x,* p1=a;p2= *b;则a和b的类型分别是( b )。 a int * 和int b int * 和int * c int 和int * d int * 和int *7设int x;,则经过( c )后,语句*px=0;可将x值置为0。 a int * px; b int const * px=&x; c int * const px=&x; d const int * px=&x
4、;8设void f1(int * m,long & n);int a;long b;则以下调用合法的是( b )。 a f1(a,b); b f1(&a,b); c f1(a,&b); d f1(&a,&b);9以下结构类型可用来构造链表的是( b )。 a struct aa int a;int * b; b struct bb int a;bb * b; c struct cc int * a;cc b; d struct dd int * a;aa b;10使用操作符setw对数据进行格式输出时,需要包含( c iomanip.h c )文件。 三、回答问题(每题4分,共20分)1设in
5、t * p;,判断下列表达式的正确性(用t表正确,用f表错误)。 -+p( t ) +(p-)( f ) p- ( f ) (+p)- ( t )2请初始化一维指针数组color,其初值表初值为red,blue,white和black。char * color=red,blue,white,black3设int x 99,98,97,& y=x1;, 写出语句 couty-,; couty*2endl;执行结果。 98,1944设int fp(char a,int b=0,double c=100.0);,判断下列重载函数的正确性。(用t表正确,用f表错误)。int fp( );( t ) v
6、oid fp(char);( f ) int fp(char,int);( f ) void fp(char,int,int);( t )5要使语句p1=new long * ;p2=new float * 15;能正常执行,写出p1和p2的定义。long * p1; float * p2;四、(每题10分,共20分)1写出下列程序的执行结果。 # include void fun(int,int,int * ); void main() int x,y,z; fun (2,3,&x); fun (4,x,&y); fun (x,y,&z); coutx,y,zendl; void fun(i
7、nt a,int b,int * c ) b*=a;*c=b-a; 4,12,442下列程序向a盘上的文本文件aaa.dat输出0至100间的整数,请将程序补充完全。 # include # include _ void main(void) ofstream f1(void main() ); if (_!f1(或f1.fail()_) cerra:aaa.dat file not open!endl; exit(1); for (int i=0;i=100;i+)_ f1_i ; f1. close()_; 五、1 编程求数列1,的所有大于等于0.000001的数据项之和并输出结果。1、#
8、include void main()int n=1,d=1;double s=0.0,s0;while(s0=double(n)/d)=0.000001)s+=s0;d+; coutsendl;2用递归方法设计函数int arraymin (int d ,int size);,其中d为数组,size为数组元素个数;arraymin返回d中的最小元素。2int arraymin(int d,int size)int k=dsize-1;if(size=1) return k;if(k=arraymin(d,size-1) return k;else return arraymin(d,size
9、-1);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 ivory coast international toure to discuss his complaint.cska general dir
10、ector 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 always find money from somebody to pay them.it is a nonsense to have matches
11、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 in our game. but it is only with harsh sanctions that racism and discrimina
12、tion 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 citys premier league match at chelsea on sunday.i am going to be at the m
13、atch 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 cskafor the racist behaviour of their fans duringcitys 2-1 win.michel platini,
14、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: we found no racist insults from fans of cska.baumgartner the disappointing
15、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 precipitation or humidity and limited cloud cover. the balloon, with capsule attac
16、hed, 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 cruising altitude of commercial airliners (5.6 miles/9.17 kilometers) and into
17、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 onto something resembling an olympic diving platform.below, the earth becomes
18、 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 into 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 stop him completely.if he goes too fast or spins out of control, he has
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 二零二五年高校博士研究生教师职务聘任合同范本3篇
- 二零二五年度跨境电子商务代理销售合同6篇
- 二零二五年空压机行业市场推广与销售合同3篇
- 二零二五年度储煤场煤炭储备与智能物流服务合同3篇
- 2024版土地贷款反担保合同范本3篇
- 二零二五年度特殊环境搬迁及环保措施合同3篇
- 二零二五版跨境担保居间交易合同细则2篇
- 展会国际物流合同(2篇)
- 二零二五版代驾服务租赁合同范本(含车辆使用限制条款)2篇
- 二零二五版快递驾驶员职业发展规划与聘用合同3篇
- 公共政策分析 课件 第8章政策评估;第9章政策监控
- 人教版八年级上学期物理期末复习(压轴60题40大考点)
- 企业环保知识培训课件
- 2024年度管理评审报告
- 暨南大学《微观经济学》2023-2024学年第一学期期末试卷
- 医药销售合规培训
- DB51-T 5038-2018 四川省地面工程施工工艺标准
- 三年级数学(上)计算题专项练习附答案
- GB/T 12723-2024单位产品能源消耗限额编制通则
- 2024年广东省深圳市中考英语试题含解析
- GB/T 16288-2024塑料制品的标志
评论
0/150
提交评论