版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、專業(yè)好文檔試卷代號:1253中央廣播電視大學(xué)2009-2010學(xué)年度第二學(xué)期“開放本科”期末考試c語言程序設(shè)計a試題2010.7一、單選題(每小題2分,共20分)1在每個c語言程序中都必須包含有這樣一個函數(shù),該函數(shù)的函數(shù)名為( )。a. main b. main c. name d. function2每個c語言程序文件的編譯錯誤分為( )類。a. 1 b. 2 c. 3 d. 43. 字符串a(chǎn)+b=12n的長度為( )。a. 6 b. 7 c. 8 d. 94. 在switch語句的每個case塊中,假定都是以break語句結(jié)束的,則此switch語句容易被改寫為( )語句。a. for b
2、. while c. do d. if5. 在下面的do-while循環(huán)語句中,其循環(huán)體語句被執(zhí)行的次數(shù)為( )。int i=0; do i+; while(i5)的相反表達(dá)式為_。6若x=5,y=10,則x!=y的邏輯值為_。7. 假定二維數(shù)組的定義為“int a35;”,則該數(shù)組所占存儲空間的字節(jié)數(shù)為_。8. 使用“typedef char bb1050;”語句定義_為含有10行50列的二維字符數(shù)組類型。9. 字符串a(chǎn):xxkfile.txt的長度為_。10假定p所指對象的值為25,p+1所指對象的值為46,則*+p的值為_。11. 假定一個數(shù)據(jù)對象為int*類型,則指向該對象的指針類型為
3、_。12假定一個結(jié)構(gòu)類型的定義為 “struct aint a,b; a* c;”,則該類型的理論長度為_。13. 假定要訪問一個結(jié)構(gòu)對象x中的數(shù)據(jù)成員a,則表示方式為_。 三、寫出下列每個程序運(yùn)行后的輸出結(jié)果(每小題6分,共30分) 1. #include void main() int i,j,k=0; for(i=0; i5; i+) for(j=i; j5; j+) k+; printf(%dn,k); 2. #include void main() int x=20; int i=2; while(ix) if(x%i=0) printf(%d ,i); x/=i; i+; 3. #
4、include void main() int a8=70,63,54,95,40,75,90,66; int i, s=0; for(i=0; i=70 & ai=90) s+=ai; printf(s=%dn,s); 4. #include int wf(int x, int y) x=x+y; y+=x; return x+y; void main() int x=3, y=5; printf(%dn,wf(x,y); 5. #include int la(int *a, int n) int i,s=0; for(i=0;in;i+) s+=ai; return s; void mai
5、n() int a5=1,2,3,4,5; int b=la(a,5)+la(a+1,3); printf(b=%dn,b); 四、寫出下列每個函數(shù)的功能(每小題6分,共12分) 1. int sg(int x) /x為大于等于2的整數(shù) int i=2; if(x=2 | x=3) return 1; while(i*i=x) if(x%i=0) break; i+; if(i*idata; f=f-next; while(f) if(f-datax) x=f-data; f=f-next; return x; 假定struct intnode的結(jié)點(diǎn)類型定義為: struct intnode
6、int data; struct intnode* next; 函數(shù)功能: 五、按照題目要求編寫程序或函數(shù)(每小題6分,共12分) 1. 編寫一個主函數(shù),計算1+3+32+.+310的值并輸出,假定分別用i,p,s作為循環(huán)變量、累乘變量和累加變量的標(biāo)識符。 2. 根據(jù)函數(shù)原型“int ff(int a, int n)”,編寫函數(shù)定義,計算并返回數(shù)組an中所有元素之和。參考答案一、單選題(每小題2分,共20分)1. a 2. b 3. b 4. d 5. c6. c 7. a 8. c 9. a 10. b二、填空題(每小題2分,共26分)1. c 2. 2 3. float 4. 335. (
7、x!=0 | y=5) 或:(x | y=5) 6. 1(真,true)7. 60 8. bb 9. 15 10. 4611. int* 12. 12 13. x.a三、寫出下列每個程序運(yùn)行后的輸出結(jié)果(每小題6分,共30分)1. 152. 2 53. s=2354. 215. b=24四、寫出下列每個函數(shù)的功能(每小題6分,共12分)1. 判斷x是否為一個素數(shù),若是則返回1,否則返回0。2. 求出并返回由f所指向的單鏈表中所有結(jié)點(diǎn)的最大值。五、按照題目要求編寫程序或函數(shù)(每小題6分,共12分)1. #include void main() int i; int p=1; int s=1; f
8、or(i=1;i=10;i+) p*=3; s+=p; printf(%dn,s); 2. int ff(int a, int n) int i,sum=0; for(i=0; in; i+) sum+=ai; return sum; winger tuivasa-sheck, who scored two tries in the kiwis 20-18 semi-final win over england, has been passed fit after a lower-leg injury, while slater has been named at full-back but
9、is still recovering from a knee injury aggravated against usa.both sides boast 100% records heading into the encounter but australia have not conceded a try since josh charnleys effort in their first pool match against england on the opening day.aussie winger jarryd hayne is the competitions top try
10、 scorer with nine, closely followed by tuivasa-sheck with eight.but it is recently named rugby league international federation player of the year sonny bill williams who has attracted the most interest in the tournament so far.the kiwi - with a tournament high 17 offloads - has the chance of becomin
11、g the first player to win the world cup in both rugby league and rugby union after triumphing with the all blacks in 2011.id give every award back in a heartbeat just to get across the line this weekend, said williams.the (lack of) air up there watch mcayman islands-based webb, the head of fifas ant
12、i-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 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
13、 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, president of european footballs governing body, has also ordered an immediate investigation into the referees actions
14、.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 news: mission aborted.the supersonic descent could happen as early as sunda.the weather plays an important role in t
15、his 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 attached, will move through the lower level of the atmosphere (the troposphere) where our day-to-day weather lives. it wi
16、ll 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 the stratosphere. as he crosses the boundary layer (called the tropopause),e can expect a lot of turbulence.the ball
17、oon 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.they blew it in 2008 when they got caught cold in the final and they will not make the same mistake against the kiwis in manchester.five yea
18、rs ago they cruised through to the final and so far history has repeated itself here - the last try they conceded was scored by englands josh charnley in the opening game of the tournament.that could be classed as a weakness, a team under-cooked - but i have been impressed by the kangaroos focus in their games since then.they have been concentrating on the sort of stuff that wins you tough, even contests - strong defence, especially on their own goal-line, completing sets and a good kick-chase. theyve been great at all the unglamorous stuff that often goes unnoticed in the
溫馨提示
- 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)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 旅游資源與品牌建設(shè)考核試卷
- 2024年企業(yè)信息化培訓(xùn)保密協(xié)議及網(wǎng)絡(luò)安全承諾3篇
- 《基于ADAMS的汽車行駛平順性仿真分析及優(yōu)化》
- 北師大五年級上冊數(shù)學(xué)分?jǐn)?shù)加減法測試題
- 2024先鋒路校區(qū)物業(yè)服務(wù)政府采購項(xiàng)目合同2篇
- 水產(chǎn)捕撈資源評估與保護(hù)-洞察分析
- 水環(huán)境風(fēng)險評估-洞察分析
- 膽囊穿孔術(shù)后護(hù)理查房
- 脫硫技術(shù)創(chuàng)新-洞察分析
- 新型病原體檢測技術(shù)-洞察分析
- 學(xué)校安全教育“一月一主題”內(nèi)容
- 葉徐版語言學(xué)綱要復(fù)習(xí)重點(diǎn)
- 人教版培智一年級上生活適應(yīng)教案
- 《季羨林自傳 我的前半生》讀書筆記思維導(dǎo)圖PPT模板下載
- 南理工2023運(yùn)籌學(xué)試卷A及答案
- 【讀寫策略】如何編寫班史
- “紅領(lǐng)巾獎?wù)隆闭聵訄D案及說明
- 人教部編版七年級語文上冊課程綱要
- 中職中專Powerpoint 2010 習(xí)題匯總(含答案)試卷
- 回流焊Reflow曲線講解
- 威布爾分布課件
評論
0/150
提交評論