![電大1253+C語言程序設計A(7月)小抄參考_第1頁](http://file2.renrendoc.com/fileroot_temp3/2021-8/28/f4164ecb-2c53-4878-afb7-422c4c573358/f4164ecb-2c53-4878-afb7-422c4c5733581.gif)
![電大1253+C語言程序設計A(7月)小抄參考_第2頁](http://file2.renrendoc.com/fileroot_temp3/2021-8/28/f4164ecb-2c53-4878-afb7-422c4c573358/f4164ecb-2c53-4878-afb7-422c4c5733582.gif)
![電大1253+C語言程序設計A(7月)小抄參考_第3頁](http://file2.renrendoc.com/fileroot_temp3/2021-8/28/f4164ecb-2c53-4878-afb7-422c4c573358/f4164ecb-2c53-4878-afb7-422c4c5733583.gif)
![電大1253+C語言程序設計A(7月)小抄參考_第4頁](http://file2.renrendoc.com/fileroot_temp3/2021-8/28/f4164ecb-2c53-4878-afb7-422c4c573358/f4164ecb-2c53-4878-afb7-422c4c5733584.gif)
![電大1253+C語言程序設計A(7月)小抄參考_第5頁](http://file2.renrendoc.com/fileroot_temp3/2021-8/28/f4164ecb-2c53-4878-afb7-422c4c573358/f4164ecb-2c53-4878-afb7-422c4c5733585.gif)
版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
1、專業(yè)好文檔c語言程序設計a課程試卷(6)題 號一二三四五總 分得 分2011年7月考 一、單選題(每小題2分,共20分) 1. c語言程序中的基本功能模塊為( )。 a. 表達式 b. 標識符 c. 語句 d. 函數(shù) 2. 邏輯表達式(x0 | y=5)的相反表達式為( )。a. x=0 | y!=5 b. x0 | y!=5 d. x0 & y=5 3. 循環(huán)體至少被執(zhí)行一次的循環(huán)語句為( )。 a. for b. while c. do-while d. 任一種循環(huán) 4. 假定n的值為5,則表達式n+的值為( )。 a. 6 b. 5 c. 4 d. 7 5. 假定一個二維數(shù)組的定義為“i
2、nt a34=3,4,2,8,6;”,則元素a20的值為( )。 a. 0 b. 2 c. 4 d. 6 6. 假定一個函數(shù)原型為“char* func(int n)”,則該函數(shù)的返回類型為( )。 a. int b. int* c. char d. char* 7. 假定a為一個字符數(shù)組名,則元素ai的指針訪問方式為( )。 a. a+i b. *(a+i) c. &a+i d. *a+i 8. 假定有語句為“int *p=calloc(10+20,sizeof(int);”,則p所指向的動態(tài)數(shù)組中所包含的元素個數(shù)為( )。 a. 10 b. 20 c. 30 d. 40 9十進制數(shù)50表示
3、成符合c語言規(guī)定的八進制數(shù)為_。 a. 20 b. 32 c. 62 d. 062 10. 若要以讀和寫兩種操作方式打開一個二進制文件,當文件不存在時返回打開失敗信息,則選用的打開方式字符串為( )。 a. r+ b. ab+ c. rb+ d. wb+ 二、填空題(每小題2分,共26分) 1. 在一個c語言程序文件中,若要包含另外一個頭文件或程序文件,則應使用的預處理命令為_。 2. 用于從鍵盤上為變量輸入值的標準輸入函數(shù)的函數(shù)名為_。 3. 假定一個枚舉類型的定義為“enum raab,ac,ad,ae;”,則ac的值為_。 4double類型的長度為_。 5. 執(zhí)行“int x=45,y
4、=13;printf(%d,x/y);”語句序列后得到的輸出結果為_。 6. 把表達式x=x+y轉(zhuǎn)換成復合賦值表達式為_。 7. 假定x的值為5,則執(zhí)行“a=(!x? 10: 20);”語句后a的值為_。 8. 假定一維字符指針數(shù)組的定義為“char* a8;”,則該數(shù)組占用的存儲空間的字節(jié)數(shù)為_。 9. 假定二維數(shù)組的定義為“double amn;”,則數(shù)組元素的行下標取值范圍在_之間。 10. 空字符串的長度為_。 11. 在所有函數(shù)定義之外定義的變量,若沒有被初始化則系統(tǒng)隱含對它所賦的初值為_。 12. 若p指向x,則_與x的表示是等價的。 13. 直接訪問表達式(*fp).score所
5、對應的間接訪問表達式為_。 三、寫出下列每個程序運行后的輸出結果(每小題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. #include void main() int a8=76,63,54,95,40,75,90,66; int i, s=0; for(i=0;
6、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=8; 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 main() int a5=1,2,3,4,5; int b=la(a,5)+la(a+2,3); printf(b=%dn,b); 四、寫出下列每個函
7、數(shù)的功能(每小題6分,共12分) 1. int wc(int a, int n, int k) int i, c=0; for(i=0;i=k) c+; return c; 函數(shù)功能: 2. void qa(struct worker a, int n) int i; for(i=0; iscore三、寫出下列每個程序運行后的輸出結果(每小題6分,共30分)評分標準:根據(jù)答案正確程度酌情給分。 1. 15 2. 2 5 3. s=241 4. 30 5. b=27四、寫出下列每個函數(shù)的功能(每小題6分,共12分)評分標準:根據(jù)答案敘述正確與完整程度酌情給分。 1. 統(tǒng)計并返回一維整型數(shù)組an中
8、大于等于k的值的個數(shù)。 2. 從鍵盤上為具有struct worker類型的數(shù)組an輸入n個記錄。五、按題目要求編寫函數(shù)(每小題6分,共12分)評分標準:根據(jù)函數(shù)編寫的正確與完整程度酌情給分。 1. double mean(double amn,int m,int n) int i,j; double v=0.0; /1分 for(i=0; im; i+) for(j=0; jn; j+) v+=aij; /4分 v/=m*n; return v; /6分 /注:函數(shù)體的最后兩行可以合并為一條返回語句:return v/=m*n 2. int mm(int a,int m) int i,x1,
9、x2; x1=x2=a0; /1分 for(i=1; ix1) x1=ai; /3分 if(aix2) x2=ai; /4分 /5分 return x1-x2; /6分 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 is still recovering from a knee i
10、njury 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 scorer with nine, closely follow
11、ed 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 becoming the first player to win the wor
12、ld 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 anti-racism taskforce, is in london
13、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 speak to him first to find out w
14、hat 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.cska said they were surprised an
15、d 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 this mission. starting at the grou
16、nd, 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 will climb higher than the tip of m
17、ount 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 balloon will slowly drift to the edge
18、 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 years ago they cruised through to th
19、e 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 stu
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 大學競選副班長申請書
- 出售轉(zhuǎn)讓貨船合同范本
- 2025年度農(nóng)副產(chǎn)品電商平臺支付結算服務合同
- 知識產(chǎn)權與商業(yè)秘密的保護策略研究
- 2025年度古建筑修復與保護工程總承包合同范本
- 動漫產(chǎn)業(yè)園改造用工協(xié)議
- 2025年中國純電動車行業(yè)市場運行態(tài)勢與投資戰(zhàn)略咨詢報告
- 精銀冶煉投資建設項目立項報告
- 電動車動力系統(tǒng)解析常見問題及應對策略
- 沖壓泵項目可行性研究報告立項申請報告范文
- 臟腑辨證與護理
- 虛擬化與云計算技術應用實踐項目化教程 教案全套 第1-14周 虛擬化與云計算導論-騰訊云服務
- 甲基丙烯酸甲酯生產(chǎn)工藝畢業(yè)設計設備選型與布置模板
- 徐金桂行政法與行政訴訟法新講義
- 瀝青拌合設備結構認知
- 2023年北京高考政治真題試題及答案
- 復旦中華傳統(tǒng)體育課程講義05木蘭拳基本技術
- 北師大版五年級上冊數(shù)學教學課件第5課時 人民幣兌換
- 工程回訪記錄單
- 住房公積金投訴申請書
- 檢驗科生物安全風險評估報告
評論
0/150
提交評論