電大1253+C語言程序設(shè)計(jì)A(7月)小抄參考_第1頁
電大1253+C語言程序設(shè)計(jì)A(7月)小抄參考_第2頁
電大1253+C語言程序設(shè)計(jì)A(7月)小抄參考_第3頁
電大1253+C語言程序設(shè)計(jì)A(7月)小抄參考_第4頁
電大1253+C語言程序設(shè)計(jì)A(7月)小抄參考_第5頁
已閱讀5頁,還剩4頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、專業(yè)好文檔試卷代號(hào):1253中央廣播電視大學(xué)2009-2010學(xué)年度第二學(xué)期“開放本科”期末考試c語言程序設(shè)計(jì)a試題2010.7一、單選題(每小題2分,共20分)1在每個(gè)c語言程序中都必須包含有這樣一個(gè)函數(shù),該函數(shù)的函數(shù)名為( )。a. main b. main c. name d. function2每個(gè)c語言程序文件的編譯錯(cuò)誤分為( )類。a. 1 b. 2 c. 3 d. 43. 字符串a(chǎn)+b=12n的長度為( )。a. 6 b. 7 c. 8 d. 94. 在switch語句的每個(gè)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ù)組所占存儲(chǔ)空間的字節(jié)數(shù)為_。8. 使用“typedef char bb1050;”語句定義_為含有10行50列的二維字符數(shù)組類型。9. 字符串a(chǎn):xxkfile.txt的長度為_。10假定p所指對(duì)象的值為25,p+1所指對(duì)象的值為46,則*+p的值為_。11. 假定一個(gè)數(shù)據(jù)對(duì)象為int*類型,則指向該對(duì)象的指針類型為

3、_。12假定一個(gè)結(jié)構(gòu)類型的定義為 “struct aint a,b; a* c;”,則該類型的理論長度為_。13. 假定要訪問一個(gè)結(jié)構(gòu)對(duì)象x中的數(shù)據(jù)成員a,則表示方式為_。 三、寫出下列每個(gè)程序運(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); 四、寫出下列每個(gè)函數(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. 編寫一個(gè)主函數(shù),計(jì)算1+3+32+.+310的值并輸出,假定分別用i,p,s作為循環(huán)變量、累乘變量和累加變量的標(biāo)識(shí)符。 2. 根據(jù)函數(shù)原型“int ff(int a, int n)”,編寫函數(shù)定義,計(jì)算并返回?cái)?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三、寫出下列每個(gè)程序運(yùn)行后的輸出結(jié)果(每小題6分,共30分)1. 152. 2 53. s=2354. 215. b=24四、寫出下列每個(gè)函數(shù)的功能(每小題6分,共12分)1. 判斷x是否為一個(gè)素?cái)?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等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論