版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、專業(yè)好文檔附件:中央廣播電視大學(xué)2007秋c+語言程序設(shè)計課程試卷(6)題 號一二三四五總 分得 分2010年7月考 一、單選題(每小題2分,共20分) 1. c+可執(zhí)行文件的默認(rèn)擴展名為( b )。 a. cpp b. exe c. obj d. lik 2. 程序運行中需要從鍵盤上輸入多于一個數(shù)據(jù)時,各數(shù)據(jù)之間應(yīng)使用( d )符號作為分隔符。 a. 空格或逗號 b. 逗號或回車 c. 逗號或分號 d. 空格或回車 3在每個c+程序中都必須包含有這樣一個函數(shù),該函數(shù)的函數(shù)名為( a )。 a. main b. main c. name d. function 4. 假定一個循環(huán)語句為“for
2、(int i=0; iy & x!=10的相反表達(dá)式為_。 4. 每個字符指針變量占用內(nèi)存的_個字節(jié)的存儲空間。 5. 執(zhí)行“typedef int datatype;”語句后,在使用int定義整型變量的地方都可以使用標(biāo)識符_來定義整型變量。 6. 對于在所有函數(shù)定義之外定義的變量,若沒有被初始化則系統(tǒng)隱含對它賦予的初值為_。 7假定p所指對象的值為25,p+1所指對象的值為46,則執(zhí)行“*(p+1);”語句后,p所指對象的值為_。 8假定一個結(jié)構(gòu)類型的定義為“struct aint a; double* b; a* c;”,則該類型的大小為_字節(jié)。 9假定一維數(shù)組的定義為“int a8;”,
3、則該數(shù)組所含元素的個數(shù)為_。 10. 若while循環(huán)語句的頭部為”while(i+=10)”,若i的初值為0,同時在循環(huán)體中不會修改i的值,則其循環(huán)體將被重復(fù)執(zhí)行_次后正常結(jié)束。 三、寫出下列每個程序運行后的輸出結(jié)果(每小題6分,共30分) 1. #include void main() int s=0; for(int i=1;i=8;i+=2) s+=i*i; couts=sendl; 輸出結(jié)果: 2. #include void main() int i=1,s=0; while(s15) s+=i+; couti,sendl; 輸出結(jié)果: 3. #include void main(
4、) int a8=36,25,48,14,55,20,47,82; int c1=0, c2=0; for(int i=0; i8; i+) if(ai50) c1+; else c2+; coutc1 c2endl; 輸出結(jié)果: 4. #include int lb(int *a, int n) int p=1; for(int i=0;in;i+) p*=*a; a+; return p; void main() int a5=1,2,3,4,3; coutlb(a,5)endl; 輸出結(jié)果: 5. #include struct worker char name15; /姓名 int a
5、ge; /年齡 float pay; /工資 ; void main() worker x=wangfong,46,1640; worker y, *p; y=x; p=&x; couty.age+10 pay*2x; y+=x*x; while(-n); return y; 函數(shù)功能: 2. bool we(int a, int b, int n) for(int i=0;in;i+) if(ai!=bi) break; if(i=n) return true; return false; 函數(shù)功能: 3. int lk(int a, int n) double s=0; int i,m=0
6、; for(i=0;in;i+) s+=ai; s=s/n; for(i=0;i=s) m+; return m; 函數(shù)功能: 五、按題目要求編寫函數(shù)(6分) 假定一個函數(shù)聲明為“int ff(int a, int n);”,要求遞歸求出數(shù)組a中所有n個元素之積并返回。中央廣播電視大學(xué)2007秋c+語言程序設(shè)計課程試卷答案及評分標(biāo)準(zhǔn)(6)(供參考)一、單選題(每小題2分,共20分)1b 2. d 3a 4. c 5c 6. a 7. a 8. b 9b 10a 二、填空題(每小題2分,共20分)1. const 2. 2*pow(x,5)3. x=y | x=10 4. 45. datatyp
7、e 6. 07. 25 8. 129. 8 10. 11三、寫出下列每個程序運行后的輸出結(jié)果(每小題6分,共30分)1. s=842. 6,15 /每個數(shù)據(jù)3分3. 6 2 /每個數(shù)據(jù)3分4. 72 /6分5. 56 3280 /每個數(shù)據(jù)3分四、寫出下列每個函數(shù)的功能(每小題8分,共24分)評分標(biāo)準(zhǔn):每題與參考答案的敘述含義相同者得8分,否則酌情給分。1.求出從鍵盤上輸入的n個整數(shù)的平方和并返回。2. 判斷具有n個元素的兩個數(shù)組a和b中對應(yīng)元素值是否全部相等,若是則返回真,否則返回假。3.統(tǒng)計出數(shù)組an中大于等于其平均值的元素個數(shù)并作為函數(shù)值返回。五、按題目要求編寫函數(shù)(6分)評分標(biāo)準(zhǔn):根據(jù)編
8、程的完整情況酌情給分。int ff(int a, int n) if(n=1) return an-1; else return an-1*ff(a,n-1); /或者if(n=0) return 1; / else return an-1*ff(a,n-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 lon
9、don for the fas celebrations - said he wanted to meet 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 nonsens
10、e 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 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 discr
11、imination.this is one of the villains we have today in 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 associ
12、ations 150th anniversary celebrations and will attend 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.
13、uefa hasopened disciplinary proceedings against cskafor 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 toure
14、s complaint. in a statement the russian side added: we 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 b
15、e very calm - winds less than 2 mph, with no precipitation 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/
16、8.85 kilometers), drifting even higher than the cruising 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 fee
17、t ( then, i would assume, he will slowly step out onto 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 t
18、he 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 a stabilization pa
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 承德護(hù)理職業(yè)學(xué)院《口腔醫(yī)學(xué)技術(shù)新進(jìn)展》2023-2024學(xué)年第一學(xué)期期末試卷
- 成都職業(yè)技術(shù)學(xué)院《新媒體數(shù)據(jù)分析與應(yīng)用實踐》2023-2024學(xué)年第一學(xué)期期末試卷
- 2025年度智慧校園班主任師徒結(jié)對人才培養(yǎng)協(xié)議6篇
- 二零二五年健身俱樂部場地租賃及運營支持合同3篇
- 2024新品科技教育產(chǎn)品進(jìn)場推廣合作合同3篇
- 二零二五年度事業(yè)單位內(nèi)部食堂承包經(jīng)營合同2篇
- 2024年私人車輛抵押車輛置換服務(wù)合同3篇
- 2024年鮮奶分銷運輸合同3篇
- 2024年苗木交易及技術(shù)協(xié)助合同
- 二零二五年度體育場館設(shè)施租賃使用合同2篇
- 火力發(fā)電廠有關(guān)職業(yè)病的危害及防護(hù)
- 民主測評票(三種樣式)
- 班車安全檢查表(2015-7-14)V3 0 (2)
- 城投集團(tuán)年度安全管理工作計劃
- 一、 行業(yè)協(xié)會申請設(shè)立分支機構(gòu)、代表機構(gòu)應(yīng)提交的文件:
- 幼兒園幼兒園理事會成員一覽表
- 學(xué)生對課堂教學(xué)滿意度調(diào)查
- 住房公積金中心窗口人員個人工作總結(jié)
- 集成電路單粒子效應(yīng)評估技術(shù)研究PPT課件
- 幼兒園小班生成活動教案20篇
- 講師與平臺的合作協(xié)議
評論
0/150
提交評論