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

下載本文檔

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

文檔簡(jiǎn)介

1、專業(yè)好文檔試卷代號(hào):1253中央廣播電視大學(xué)2009-2010學(xué)年度第一學(xué)期“開(kāi)放本科”期末考試c語(yǔ)言程序設(shè)計(jì)a試題 一、單選題(每小題2分,共20分)1. c語(yǔ)言源程序文件的缺省擴(kuò)展名為( )。a. cpp b. exec. obj d. c2設(shè)x和y均為邏輯值,則x & y為真的條件是( )。a. 它們均為真 b. 其中一個(gè)為真c. 它們均為假 d. 其中一個(gè)為假3. 在下列的符號(hào)常量定義中,正確的定義格式為( )。a. #define m1 b. const int m2 20c. #define m3 10 d. const char mark4. for循環(huán)語(yǔ)句能夠被改寫(xiě)為( )語(yǔ)句

2、。a. 復(fù)合 b. ifc. switch d. while5. 在下面的一維數(shù)組定義中,錯(cuò)誤的定義格式為( )。a. int a=1,2,3 b. int a10=0c. int a d. int a56下面的函數(shù)原型聲明中存在語(yǔ)法錯(cuò)誤的是( )。a. aa(int a, int b) b. aa(int, int)c. aa(int a; int b;) d. aa(int a, int)7. 假定a為一個(gè)數(shù)組名,則下面存在錯(cuò)誤的表達(dá)式為的( )。a. ai b. *a+c. *a d. *(a+1)8. 假定有定義為“int a10, x, *pa=a;”,若要把數(shù)組a中下標(biāo)為3的元素值

3、賦給x,則不正確的賦值為( )。a. x=pa3 b. x=*(a+3)c. x=a3 d. x=*pa+39char類(lèi)型的長(zhǎng)度為_(kāi)個(gè)字節(jié)。a. 1 b. 2 c. 3 d. 410. 向一個(gè)二進(jìn)制文件中寫(xiě)入信息的函數(shù)為( )。a. fgets() b. fputs()c. fread() d. fwrite()二、填空題(每小題2分,共26分)1. c語(yǔ)言中的每條復(fù)合語(yǔ)句以_作為結(jié)束符。2. 在#include命令中所包含的文件,可以是頭文件,也可以是_文件。3. 十進(jìn)制數(shù)35對(duì)應(yīng)的八進(jìn)制數(shù)為_(kāi)。4. 假定x=5,則表達(dá)式2+x+的值為_(kāi)。5增量表達(dá)式+y表示成賦值表達(dá)式為_(kāi)。6若x=5,y

4、=10,則xy的值為_(kāi)。7. 假定二維數(shù)組的定義為“int a35;”,則該數(shù)組所含元素的個(gè)數(shù)為_(kāi)。8. 執(zhí)行“typedef int abc10;”語(yǔ)句把a(bǔ)bc定義為具有10個(gè)整型元素的_類(lèi)型。9. strcat()函數(shù)用于_兩個(gè)字符串。10假定p所指對(duì)象的值為25,p+1所指對(duì)象的值為46,則*p+的值為_(kāi)。11. 若要把一個(gè)整型指針p轉(zhuǎn)換為字符指針,則采用的強(qiáng)制轉(zhuǎn)換表達(dá)式為_(kāi)。12. null是一個(gè)符號(hào)常量,通常作為空指針值,它對(duì)應(yīng)的值為_(kāi)。13. 假定要?jiǎng)討B(tài)分配一個(gè)類(lèi)型為struct worker的對(duì)象,并由r指針指向這個(gè)對(duì)象,則使用的表達(dá)式為 _ =malloc(sizeof(str

5、uct worker)。 三、寫(xiě)出下列每個(gè)程序運(yùn)行后的輸出結(jié)果(每小題6分,共30分) 1. #include void main() int i,s=0; for(i=1;i6;i+) s+=i*i; printf(“s=%dn”,s); 2. #include #define n 6 void main() int i,an=2,5,8,10,15,21; for(i=0; in; i+) if(ai%5) printf(%d ,ai); printf(n); 3. #include #include void main() int i; unsigned int len; char* a

6、5=student,worker,cadre,soldier,zzeasan123; len=strlen(a0); for(i=1; ilen) len=strlen(ai); printf(%dn,len); 4. #include void main() int a,b; for(a=2,b=3; b20;) printf(%d %d ,a,b); a=a+b; b=a+b; printf(%d %dn,a,b); 5. #include void le(int* a, int* b) int x=*a; *a=*b; *b=x; void main() int x=15, y=26;

7、printf(%d %dn,x,y); le(&x,&y); printf(%d %dn,x,y); 四、寫(xiě)出下列每個(gè)函數(shù)的功能(每小題6分,共12分) 1. #include int sg(int x) /x為大于等于2的整數(shù) int a=(int)sqrt(x); /sqrt(x)取x的平方根 int i=2; while(i=a) if(x%i=0) break; i+; if(idata; f=f-next; while(f) if(f-datax) x=f-data; f=f-next; return x; 假定struct intnode的類(lèi)型定義為: struct intnode

8、 int data; struct intnode* next; 函數(shù)功能: 五、按題目要求編寫(xiě)程序或函數(shù)(每小題6分,共12分) 1. 編寫(xiě)一個(gè)程序,輸出50以內(nèi)(含50)的、能夠被3或者5整除的所有整數(shù)。 2. 編寫(xiě)一個(gè)遞歸函數(shù)“int ff(int a, int n)”,求出數(shù)組a中所有n個(gè)元素之積并返回。參考答案一、單選題(每小題2分,共20分) 1. d 2. a 3. c 4. d 5. c 6. c 7. b 8. d 9. a 10. d 二、填空題(每小題2分,共26分)1. (或右花括號(hào)) 2. 程序 3. 43 4. 75. y=y+1 6. 0(假) 7. 15 8.

9、數(shù)組9. 連接 10. 25 11. (char*)p 12. 013. struct worker* r三、寫(xiě)出下列每個(gè)程序運(yùn)行后的輸出結(jié)果(每小題6分,共30分) 1. s=55 2. 2 8 21 3. 10 4. 2 3 5 8 13 21 5. 15 26 26 15四、寫(xiě)出下列每個(gè)函數(shù)的功能(每小題6分,共12分) 1. 判斷x是否為一個(gè)素?cái)?shù),若是則返回1,否則返回0。 2. 求出由f所指向的單鏈表中所有結(jié)點(diǎn)的最大值。 五、按題目要求編寫(xiě)程序或函數(shù)(每小題6分,共12分) 1. #include void main() int i; for(i=3; i=50; i+) if(i%

10、3=0 | i%5=0) printf(%d ,i); printf(n); 2. int ff(int a, int n) if(n=0) printf(n值非法n),exit(1); if(n=1) return an-1; else return an-1*ff(a,n-1); 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 bee

11、n named at full-back but 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

12、 the competitions top try 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 -

13、has the chance of becoming 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 we

14、bb, 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 match tomorrow and i have asked to meet yaya toure, he told bbc sport.for me its about how he

15、 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, president of european footballs governing body, has also ordered an immediate investigation

16、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 news: mission aborted.the supersonic descent could happen as early as sunda.the weather pla

17、ys 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 attached, will move through the lower level of the atmosphere (the troposphere) where our day-to

18、-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 the stratosphere. as he crosses the boundary layer (called the tropopause),e can expect a l

19、ot 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.they blew it in 2008 when they got caught cold in the final and they will not make the same mistake against the kiw

20、is in manchester.five years 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 b

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(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)論