2014韩山师范学院专插本《高级语言程序设计》样卷
2015韩山师范学院《高级语言程序设计》样卷.doc

韩山师范学院专升本插班生考试样卷计算机科学与技术专业高级语言程序设计样卷一、填空题(每空1分,共10分)1.C语言的数据类型中,构造类型包括:数组、结构体和共用体。
2.在C程序中,指针变量能够赋地址值或变量值。
3.C目标程序经连接后生成扩展名为exe的可执行程序文件。
4.设有定义语句 static char s[5」;则s[4]的值是0。
5.设x为int型变量。
与逻辑表达式!x等价的关系表达式是X==0。
6.若一全局变量只允许本程序文件中的函数使用,则该变量需要使用的存储类别是static 。
7.磁盘文件按文件读写方式分类可以为顺序存取文件和随机存取文件。
8.设有下列结构体变量xx的定义,则表达式sizeof(xx)的值是_________。
struct{ long num;char name[20];union{float y; short z;} yz;}xx;二、单项选择题(每小题1.5分,共30分)1.设有定义int x=8, y, z; 则执行y=z=x++, x=y= =z; 语句后,变量x值是( B )A、0B、1C、8D、9逗号表达式的运算过程为:从左往右逐个计算表达式所以先计算y=z=x++;y=z=x=8,x再自加,x=9再计算x=y==z;y=z=8,所以y==z为真,x=12.有以下程序main( ){ int i=1,j=1,k=2;if((j++‖k++)&&i++) printf("%d,%d,%d\n",i,j,k);} 执行后输出结果是( C )A、1,1,2B、2,2,1C、 2,2,2D、2,2,3[解析] 该题目的关键是要搞清楚“&&”和“‖”两个逻辑运算符的运算功能。
运算符“&&”和“‖”是双目运算符,要求有两个运算量。
且规定逻辑与运算中,只有前面运算量的值为真时,才需要判别后面的值。
只要前面为假,就不必判别后面的值。
2014年本科插班生考试《C语言程序设计》课程试卷

韩山师范学院2014年本科插班生考试试卷教育技术学专业 C语言程序设计试卷(A卷)一、填空题(每空1分,共10分)1.C语言的标识符必须以________或________开头。
2.C语言程序的执行是从________函数开始。
3.fgets函数的作用是从指定文件读入一个________。
4.表达式13%10的结果是________。
5. 若有定义:int a[3][5];则数组a中共有________个元素。
行下标的下界是________,行下标的上界是________。
6. 若x=3,y=2,则 x|y<<2的结果是___________。
7.数据的输入输出是针对________而言的。
1. 一个C程序的执行是从__________A.main()函数开始,直到main()函数结束B.第一个函数开始,直到最后一个函数结束C .第一个语句开始,直到最后一个语句结束D .main()函数开始,到最后一个函数结束 2. 一个C 程序是由__________。
A .一个主程序和若干子程序组成 B .一个或多个函数组成 C .若干过程组成D .若干子程序组成3. 下面不正确...的字符串常量是_________。
A. 'abc'B. "12'12"C. "0"D. " "4.以下结果为整数的表达式(设有int i;char c;float f;)_________ A.i+fB.i*cC.c+fD.i+c+f5. 设char ch;以下正确的赋值语句是_________ A.ch= '123’; B.ch= '\xff ’; C.ch= '\08’;D.ch=”\”;6. 设int m=1,n=2,则m=n 的值是_________ A.0B.1C.2D.37. 如下程序的执行结果是_________main() {int n=1,m=2;printf("%d %d ",++n,m++);} A.2 1B.1 2C.2 2D.1 18. 设int a=1,b=2,c=3; 则表达式a==c||a+b>=c 的值是__________ A. F B. 0 C. 1 D. T9. C 语言对嵌套if 语句的规定是:else 总是与 __________ 配对。
2014年韩山师范学院本科插班生考试《数据结构》课程试卷

韩山师范学院2014年本科插班生考试试卷计算机科学与技术专业 数据结构 试卷(A 卷)一、 单项选择题(每题2分,共30分)1. 栈和队列的共同特点是( A )。
A. 只允许在端点处插入和删除元素B. 都是先进后出C. 都是先进先出D. 没有共同点 2. 用链接方式存储的队列,在进行插入运算时( D )。
A. 仅修改头指针 B. 头、尾指针都要修改 C. 仅修改尾指针 D. 头、尾指针可能都要修改 3. 以下数据结构中哪一个是非线性结构?( D )A. 队列B. 栈C. 线性表D. 二叉树 4. 设有一个二维数组A[m][n],假设A[0][0]存放位置在644,A[2][2]存放位置在676,每个元素占一个空间,问A[3][3]存放在什么位置?( C ) A .688 B .678 C .692 D .696//对的.676+(676-644)/2A[2][2]与A[0][0] 相差两排零2个元素A[3][3]与A[2][2] 相差一排零1个元素因为元素的地址是连续的5. 树最适合用来表示( C )。
A.有序数据元素B.无序数据元素C.元素之间具有分支层次关系的数据D.元素之间无联系的数据6. 二叉树的第k层的结点数最多为( D )。
A.2k-1 B.2K+1 C.2K-1 D. 2k-17. 设有向无环图G中的有向边集合E={<1,2>,<2,3>,<3,4>,<1,4>},则下列属于该有向图G的一种拓扑排序序列的是(A)。
A. 1,2,3,4B. 2,3,4,1C. 1,4,2,3D. 1,2,4,3//拓扑排序,每个结点的所有前驱结点都排在该结点的前面。
有向无环图中,拓扑排序:1.包含所有顶点2.若序列有顶点A在B的前面,则图不存在B->A的边。
即,若图中存在B->A,则B 在A的前面故BCD不对8. 下列关于数据结构的叙述中,正确的是(A)。
韩山师范学院本科插班生考试《高级语言程序设计》课程试卷教学内容

2014年韩山师范学院本科插班生考试《高级语言程序设计》课程试卷韩山师范学院2014年本科插班生考试试卷计算机科学与技术 专业 高级语言程序设计 试卷(A 卷)一、填空题(每空1分,共10分)1.C 程序是由___函数__构成的,它包括___函数首部_和_函数体__两部分。
2.一个C 文件是一个字节流或___二进制_ 流。
3. 在C 语言中,&运算符作为单目运算符时表示的是__取地址__运算,作为双目运算符时表示的是___按位与__运算。
4. 在16位PC 机环境下,字符常量‘a ’在内存中应占__1___个字节,字符串“a”应占____2____个字节。
//后面系统自动加‘/0’。
5. 数组在内存中占用一段连续的存储空间,它的首地址由___数组名__表示。
6. 当a=9,b=40,c=3时,表达式 a>b!= c 的值是 __1_____。
二、单项选择题(每题1.5分,共30分)1.下述程序段的输出结果是(C)。
int x=10;int y=x++;printf(″%d,%d″,(x++,y),y++);A、11,10B、11,11C、10,10D、10,112.下面各选项中,均是C语言标识符的选项组是(B)。
A、for china toB、long_123 short56 _doC、void union _342D、text.txt _023 _3ew3.有以下程序,执行后输出结果是(A)。
main(){ int a[][3]={{1,2,3},{4,5,0}},(*pa)[3],i;pa=a;for(i=0; i<3; i++)if(i<2) pa[1][i] = pa[1][i]-1;else pa[1][i]=1;printf("%d\n",a[0][1]+a[1][1]+a[1][2]);}A、7B、6C、8D、无确定值4. 算法是指为解决某个特定问题而采取的正确且有限的步骤,下面不属于算法的5个特性的是(B)。
高级语言程序设计试题(A)卷

2011—2012学年度下学期期末考试11 级计算机教育专业(三年制)高级语言程序设计试题(A)卷(请将答案写在答题纸上,并写清考试课程名称、考场编号、考试时间及题号)一、填空(每空1分,共10分)1.C语言中普通整型变量的类型说明符为()。
2.设整型变量n的值为2,执行语句“n+=n-=n*n;”后,n的值是()。
3.C语言中基本的数据类型有:整型、()、字符型。
4.有如下语句:char A[]={"student"}; 数组A的元素个数为()个。
5.有如下输入语句:scanf("a=%d,b=%d,c=%d",&a,&b,&c);为使变量a的值为1,b的值为3,c的值为2,从键盘输入数据的正确形式应是()。
6.C语言的预处理语句以()开头。
7.C程序设计中语句后的符号/*……*/ 所起作用是()。
8.结构化程序设计方法规定程序或程序段的结构有三种:顺序结构、选择结构和()。
9.用{}把一些语句括起来称为()语句。
10.变量Y满足以下两条件中的任意一个:①能被4整除,但不能被100整除;②能被400整除。
请用C 语言逻辑表达式表示所给条件,条件为()。
二、单项选择(每小题2分,共40分)1.设整型变量a为5,使b不为2的表达式是()。
A.b=a/2B.b=6-(--a)C.b=a%2D.b=a>3?2:12.以下说法中正确的是()。
A.C语言程序总是从第一个的函数开始执行B.在C语言程序中,要调用的函数必须在main()函数中定义C.C语言程序总是从main()函数开始执行D.C语言程序中的main()函数必须放在程序的开始部分3.以下程序的输出结果是( )。
int x=10,y=10;printf("%d %d\n",x--,--y);A.10 10B.9 9C.9 10D.10 94.选出下列标识符中不是合法的标识符的是()。
韩山师范学院2014年本科插班生《英语语法》试卷

韩山师范学院2014年本科插班生《英语语法》试卷2014年韩山师范学院本科插班生考试英语专业英语语法试卷 ( A卷 )得分评卷人I. Choose the correct answer ( 40% )Directions: Complete the following sentences with oneof the four items which marked A,B,C and D and then write down the corresponding letter on the ANSWER SHEET.1.We have been told that under no circumstances ______ the telephone in the office for personal affairs.A.did we useB. may we useC. we may useD. we could use2._______, he does get annoyed with her sometimes.A.As he likes her muchB. Although much he likes herC. Much as he likes herD. Much although he likes her3.A man escaped from the prison last night. It was a long time ______ the guards discovered what had happened.A.beforeB. untilC. sinceD. when4.We hadn’t met for 20 years, but I recognized her _______ I saw her.A.the momentB. for the momentC. the moment whenD. at the moment when5.She never laughed, ______ lose her temper.A.or she ever didB. nor did she everC. or did she everD. nor she ever did6. That guy was ______ than I thought.A. as much of a foolB. enough of a foolC. fool enoughD. less of a fool7. We do not do much ______ with him.A. commerceB. businessesC. businessD. enterprise8. I like these dishes but ______ is a little too small.A. the tea cupB. the cup of teaC. the tea’s cupD. the cup for the tea9. My sister has a ______ baby.A. two-months-oldB. two-month oldC. two-months-oldsD. two-month-old10. The students spent ______ their time working in the field.A. bothB. mostC. moreD. half11. In Australia the Asians make their influence _____ in business large and small.A. feelingB. feelC. feltD. to be felt12. ______ for my illness, I would have lent him a helping hand.A. Not beingB. Had it not beenC. Without beingD. Not having been13. His sister always keeps herself ______.A. clearlyB. cleanC. clearD. cleanly14. I’d rather you _______make any comment on the issue for the time being.A. don'tB. wouldn'tC. didn'tD. shouldn't15. Mrs. Brown is supposed ______ for Italy last week.A. to have leftB. to be leavingC. to leaveD. to have been left16. How can I ever concentrate if they______ me with theirprivate affairs?A. continually interruptB. are continually interruptingC. have continually interruptedD. have interrupted continually17.With all the children ______ at home during the holidays, she has a great deal of work to do.A. beingB. wasC. having beenD. were18. My watch is nowhere to be found. I ______ when I was on the bus.A. must drop itB. must have dropped itC. should have dropped itD. ought to have dropped it19. My transistor radio isn’t working. It _______.A. need repairingB. needs repairingC. needs to repairD. needs to be repaired20. The teacher demanded that her students ______ on time to every class.A. wereB. beC. had to beD. must have to be21. The government is committed_____a number of underdeveloped countries.A. to helpB. of helpingC. to helpingD.helping22. _____ you were busy, I wouldn’t have bothered you with my questions.A. If I realizedB. Had I realizedC. Did I have realized thatD. As I realized23. There are ______ books ______ are needed.A. as many...whichB. as much...asC. as many...asD. many...as24.What ______ would happen if the director knew you felt that way?A. do you supposeB. you supposeC. will you supposeD. you would suppose25.The whole classroom is in a mess, because preparations_____for the musical evening.A. are makingB.have been madeC.are being madeD.have made26. After searching for half an hour, she realized that her glasses ______ on the table all the time.A. were lainB. had been lainC. have been lyingD. had been lying27. Would you open the window, please? Yes, I ______.A.willB.wouldC.doD.can28. Their suggestion was that the program _______.A. will changeB. changesC. should changeD. be changed29. Cast iron ______ six different substances.A. is consisted ofB. consists ofC. is composed fromD. composes from30.The prices go on______.A. to riseB. risingC. risenD. to be risen31. At______time and under _____circumstances will China be the first to use nuclear weapons.A.not…..notB.any…anyC.no…noD.neither…nor32.The director will_______ someone to do Chang’s work,when he is away.A.take outB.take inC.take overD.take on33. Not until we came to Japan ______ what kind of a country she is.A. we knewB. did we knowC. we didn’t knowD. we could know34. Information is needed as to __________.A. which is the type of fuel most suitableB. the most suitable type of fuel is whichC. which type of fuel is most suitableD. which type of fuel most suitable is35. If you try to swim across the river, you’ll drown, _______?A. wouldn’t youB. won’t youC. don’t youD. will you36. The door burst open _______.A. and in rushed the crowdB. in the crowd rushedC. in rushed the crowdD. in did the crowd rush37.There are more than 50 proposals ______ at the conference.A. discussedB. discussingC. to be discussedD. having been discussed38. What a stupid boy, _______?A. doesn’t heB. isn’t heC. hasn’t heD. won’t he39. It was essential that the application forms ______ back before the dead line.A. must be sentB. would be sentC. be sentD. were sent40.The manager promised to keep me ______ of how our business was going on.A. to be informedB. on informingC. informed D informing得分评卷人II. Correct the errors in the following sentences( 20% )Directions: Each sentence contains four underlined parts which marked A, B,C and D. Identify the one that would not be acceptable in standard written English. Mark out the incorrect one and correct it and then write down your answers on the ANSWER SHEET.1.We should be ready at all time to wipe out any enemy who dares to come.A B C D2. An organ is a group of tissues capable to perform some special function, asA B Cfor example, the heart, the liver, or the lungs.D3. I regret having left the work unfinished; I should plan everything aheadA B C D carefully.4. By the time you get to Greenwich you will see the most historic parts ofA B C DLondon.5.The cast-iron possesses certain properties which make them very useful in theA B C Dmanufacture of machinery.6. Would you consider to give her another five minutes before giving up waitingA B C Dfor her altogether?7. I am going to have my letters type tomorrow afternoon if I’ve got them readyA B C D by then.8. I had spent months to build my fiber-glass boat, and now that it was ready, IA Bwanted all my friends to come and see it.C D9. Statistics are his most difficult subject and Benjamin is worried that he won’tA B C D pass the test.D10. When I was a boy, I was used to swim in the river which was not far awayA B Cfrom the high way.D11.The ban on nuclear arms had much supporters, both liberal and conservative,A Bfrom all over the world.C D12.A tall woman dressed in mourning walked through the door quietly andA B Cseated her at the table in the corner of the room.D13. No matter how his limitations are, Shaw has succeeded to exposing the evilsA B C Dof bourgeois democracy.14. No sooner had he begun to speak when an ominous muttering arose from theA B C D audience.15. Mary told my sister and me that Ann went to Canada six months ago.A B C D16. He is a strong healthful man; he rises early, works hard, lives on healthful fareA B Cand enjoys refreshing sleep.D17. Erosion, which washes away valuable topsoil, can be prevent by plantingA B Ctrees and grass.D18.His account of which he had done that year did not satisfy his colleague.A B C D19.She wished that we didn’t send her the candy yesterday because she’s on aA B C D diet.20.Waiting for a plane to take off from an airport can often take so long as theA B Ctrip itself.D得分评卷人III. Fill in the blanks with the proper forms of thewords given in the brackets ( 20% )1. Visitors are asked ______( not feed ) the animals.2. Tom is one of the boys who _____( be ) always on time.3. This project _______( complete ) by the end of next year.4. It causes a lot of ______( convenience ) when there is power supply failure.5. Her _____( late ) book is called Second Class Citizen.6. The committee didn’t approve the ______( suggest ) changes.7. I don ’t want that sort of thing ______( keep ) happening.8. It is absolutely essential that all the facts ______( examine ) first.9. If need ______( be ) , we can always bring another car.10. I insist on them _____( punish )11.The Reform Club proposed that wages _______( raise )12. He was afraid of_______( scold ).13. Not only the earth but also the planets ______( move ) round the sun.14. Asia as well as other continents ______( have ) very rich natural resources.15. Seeing the teacher came in, they pretended ______( work) hard.16. Give this letter ______( direct ) to the postman.17. The leaves _____ (fall) on the ground should be cleared away.18. Mary ’s ______( nice ) of the four girls in the family.19. Will your ______( increase ) salary enable you to buy a new car?20. I should like ______( he, start ) taking more English lessons.IV . Fill in the blanks with proper Prep. Adv. Determiner , Coordinator or Subordinator ( 10% )1. Your plan is far _____ perfect.2. Which do you like _____, coffee, tea or lemonade?3. He said it didn ’t matter _______ we stayed or went.4. It was ______ he was ill that he didn ’t go with us.5. John got a job, so that he could be independent _____ his parents.6. Is the city noted ______ its champagne?7. Mrs Cox is both kind _____ gentle to her pupils.8. You can approach my secretary _____ case of need.9. The manager will have to hire two people to make ______ for the lost time.10. He borrowed the money _____ he was able to finish his education.V . Rewrite the following sentences according to the requirements given in the brackets ( 10% )( Active voice------- Passive voice )1. People believe that he is ill.2. Didn ’t they tell you to be here by six o ’clock?( Combine each group of sentences into one sentence, using proper Coordinator or Subordinator )得分评卷人得分评卷人3. He ate too little and worked too hard for weeks on end. He became ill.4. Tom speaks Chinese fluently. He can't write in it.( Direct speech-------- Indirect speech )5.He said, “ If what you said is true I must go to the police.”6. “ Must I go to school tomorrow?” Jack asked.( Turn the following sentences into existential ‘there’ )7.A car was ready for us..8. A meeting about the new building took place yesterday.( Emphasize the italicized斜体part by using introductory ‘ it’ )9. He is determined to pass the test.10.They have painted the wall green.。
2014年韩山师范学院本科插班生《C语言程序设计》试卷

2014年韩山师范学院本科插班生考试试卷教育技术学专业 C语言程序设计试卷(A卷)一、填空题(每空1分,共10分)1.结构化程序设计方法规定程序或程序段的结构有三种:、选择结构和循环结构。
2.在内存中存储"A" 要占用个字节,存储'A' 要占用字节。
3.有语句:char A[]={"I am a student"};该字符串的长度是,A[3]= 。
4.能表述"20<x<30" 的C语言表达式是。
5.C语言的预处理语句以_____ _____开头。
6.数组名代表数组的。
7.C语言中字符串的结束符是。
8.定义fp为文件型指针变量的定义方法为__ _______。
二、单项选择题(每题1.5分,共30分)1、下面标识符中,不合法的用户标识符为________。
A.hot_do B.cat1 C._pri D.2ab2、下列叙述中正确的是________。
A.每个C源文件中都必须有一个main()函数B.在C程序中main()函数的位置是固定的C.一个C程序只能由一个源文件组成D.在C程序的函数中不能定义另一个函数3.以下变量x.、y、z均为double类型且已正确赋值,不能正确表示数学式子x/yz的C语言表达式是________。
A.x/y*z B.x*(1/(y*z)) C.x/y*1/z D.x/y/z4.printf函数中用到格式符%5s,其中数字5表示输出的字符串占用5列,如果字符串长度大于5,则输出按________方式。
A.从左起输出该字符串,右补空格B.按原字符长从左向右全部输出C.右对齐输出该字串,左补空格D.输出错误信息5、以下程序段的输出结果是________。
char str[15]=”hello!”;printf(“%d\n”,strlen(str));A.15 B.14 C.7 D.66.巳知字母A的ASCII码是65,以下程序的执行结果是________。
高级语言程序设计习题及答案

习题一1-1 Pascal语言的程序结构由哪几部分组成?试述各部分的构成形式和作用。
1-2 Pascal基本字符集有哪些成分构成?Pascal的保留字是什么?1-3 Pascal语言中标识符是怎样构成的?下列字符串哪些是正确的Pascal标识符?哪些是错误的?为什么?A5B,5H4,PEL,1,A31,x﹡y,AB,A + B,$500,G1(x),xyz,E-10,VAR1-4 下列数据哪些是整数?哪些是实数?哪些是非法的(假设计算机字长为32位)?256 2.54 25E+6 3.75E6 0.15E-61.2E70 1E-15 -673 E8 4,7345.7E-6.6 0 58989 -73451 E-31-5 下列哪些常量定义是正确的?CONSThvalue=200;lvalue=0 OR 1 OR 2;firstchar=’a’;t=true;b=true OR false;1-6 假定已作了下述说明:CONSTgap=’’;VARm,n:integer;a,b:real;p,q:boolean;c1,c2:char;指出下列每一语句是否有效,并说明理由:⑴m:=trunk(b)+a⑵p:=m+n⑶read(c1,c2,’’)⑷c1:=gap⑸p:=q AND (ord(c1)<>’a’)⑹m:=n MOD a⑺‘c1’ :=’c2’⑻c2:=chr(‘a’)⑼m:=m-ord(‘0’)⑽writeln(a,p,m,n,q,q,b)⑾ n:=a-trunc(a)⑿b:=2.99*109⒀a:=m/n⒁b:ord(c1)+ord (c2)1-7 已知变量有下面指定的值:a=7,b=-6,c=30,d=10.8600,e=1E3,f=’*’,g=true求下面表达式的值:a+b DIV trunc(d)+3①d-0.75/(e+140.0)*70.0②sqrt(abs(b-a)+succ(ord(f))③chr(10* a MOD sqr(b))④NOT ((a>=b) AND g)⑤(ord(b) OR (sqr(b)>e)) AND (g AND NOT(abs(b)<>6))1-8 已知有如下说明VARp,q,r,s:Boolean;k:integer;试写出下列每一表达式的类型,如能确定,请写出它们的值。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
韩山师范学院专升本插班生考试样卷计算机科学与技术专业高级语言程序设计样卷一、填空题(每空1分,共10分)1.C语言的数据类型中,构造类型包括:数组、和。
2.在C程序中,指针变量能够赋值或值。
3.C目标程序经后生成扩展名为exe的可执行程序文件。
4.设有定义语句 static char s[5」;则s[4]的值是。
5.设x为int型变量。
与逻辑表达式!x等价的关系表达式是。
6.若一全局变量只允许本程序文件中的函数使用,则该变量需要使用的存储类别是。
7.磁盘文件按文件读写方式分类可以为顺序存取文件和。
8.设有下列结构体变量xx的定义,则表达式sizeof(xx)的值是_________。
struct{ long num;char name[20];union{float y; short z;} yz;}xx;二、单项选择题(每小题1.5分,共30分)1.设有定义int x=8, y, z; 则执行y=z=x++, x=y= =z; 语句后,变量x值是( )A、0B、1C、8D、92.有以下程序main( ){ int i=1,j=1,k=2;if((j++‖k++)&&i++) printf("%d,%d,%d\n",i,j,k);} 执行后输出结果是( )A、 1,1,2B、2,2,1C、 2,2,2D、2,2,33.已知i、j、k为int型变量,若从键盘输入:1,2,3<回车>,使i的值为1、j的值为2、k的值为3,以下选项中正确的输入语句是( )A、scanf( “%2d%2d%2d”,&i,&j,&k);B、scanf( “%d %d %d”,&i,&j,&k);C、scanf( “%d,%d,%d”,&i,&j,&k);D、scanf( “i=%d,j=%d,k=%d”,&i,&j,&k);4.有以下程序main(){ int a=5,b=4,c=3,d=2;if(a>b>c) printf("%d\n",d);else if((c-1>=d)= =1) printf("%d\n",d+1);else printf("%d\n",d+2);} 执行后输出结果是 ( )A、2B、3C、 4D、编译时有错,无结果5.以下程序段 ( )x=1;do { x=x*x;} while (!x);A、是死循环B、循环执行二次C、循环执行一次D、有语法错误6.以下不能正确定义二维数组的选项是( )A、int a[2][2]={{1},{2}};B、int a[][2]={1,2,3,4};C、int a[2][2]={{1},2,3};D、int a[2][]={{1,2},{3,4}};7.有以下程序main(){ int aa[4][4]={{1,2,3,4},{5,6,7,8},{3,9,10,2},{4,2,9,6}};int i,s=0;for(i=0;i<4;i++) s+=aa[i][1];printf(“%d\n”,s);}程序运行后的输出结果是 ( )A、11B、19C、 13D、208.以下程序的输出结果是 ( )main(){ char ch[3][5]={"AAAA","BBB","CC"};printf("\"%s\"\n",ch[1]);}A、"AAAA"B、"BBB"C、"BBBCC"D、"CC"9.有以下程序#define f(x) x*xmain( ){ int i;i=f(4+4)/f(2+2);printf(“%d\n”,i);} 执行后输出结果是( )A、28B、22C、16D、410.决定C语言中函数返回值类型的是()。
A、return语句中的表达式类型B、调用该函数的主调函数类型C、调用函数时临时指定的类型D、定义函数时在函数首部中所指定的类型(若缺省,则隐含为int型)。
11.系统对预处理命令(如宏替换、文件包含、条件编译)的处理时机是()。
A、编译源程序B、编译源程序之前C、连接目标文件时D、运行程序时12.在位运算中,操作数每左移一位,其结果相当于()A、操作数乘以2 C、操作数除以2B、操作数除以4 D、操作数乘以413.下述描述中不正确的是()。
A、字符型数组中可以存放字符串B、可以对字符型数组进行整体输入、输出C、可以对整型数组进行整体进行输入、输出D、不能在赋值语句中通过赋值运算符“=”对字符型数组进行整体赋值14.若有以下定义 int a[2][3],则对a数组第i行第j列元素的正确引用是( )A、*(*(a+i)+j)B、(a+i)[j]C、*(a+i+j)D、*(a+i)+j15.有以下程序void fun(char *a, char *b){ a=b; (*a)++; }main(){ char c1='A',c2='a',*p1,*p2;p1=&c1; p2=&c2;fun(p1,p2);printf("%c%c\n",c1,c2);}程序运行后的输出结果是( )A、AbB、aaC、AaD、Bb16.已定义以下函数Fun (char *p2, char * p1){ while((*p2=*p1)!=' \0'){ p1++;p2++; }}函数Fun的功能是( )A、将p1所指字符串复制到p2所指内存空间B、将p1所指字符串的地址赋给指针p2C、对p1和p2两个指针所指字符串进行比较D、检查p1和p2两个指针所指字符串中是否有'\0'17.设有以下结构体类型:struct st{ char name[8];int num;float s[4];}student[50];并且结构体数组student中的元素都已有值,若要将这些元素写到硬盘文件fp中,以下不正确的形式是( )A、fwrite(student,sizeof(struct st),50,fp);B、fwrite(student,50*sizeof(struct st),1,fp);C、fwrite(student,25*sizeof(struct st),25,fp);D、for(i =0;i<50;i++)fwrite(student+i, sizeof(struct st),1,fp);18.若有说明语句char a[ ]= "It is mine";char *p=" It is mine";则以下不正确的叙述是()A、a+1表示的是字符t的地址B、p指向另外的字符串时,字符串的长度不受限制C、p变量中存放的地址值可以改变D、a中只能存放10个字符19.当调用函数时,实参是一个数组名,则向函数传送的是 ( )A、数组的长度B、数组的首地址C、数组每一个元素的地址D、数组每一个元素中的值20.设有变量说明 int a=3,b=6; char c; 若执行赋值语句 c=(a^b)<<2;则c的二进制值是()。
A、00011100B、00000111C、00000001D、00010100三、阅读程序,将运行结果写到各题右侧的空白处(每小题4分,共20分)1.#include <stdio.h>main(){ char str[]="1234567";int i;for(i=0; i<7; i+=3)printf("%s\n", str+i);}2.#include <stdio.h>main(){ int i;for(i=0;i<3;i++)switch(i){ case 0: printf("%d",i);case 2: printf("%d",i);default: printf("%d",i);}}3.#include <stdio.h>main(){int i;for (i=1;i<6;i++){if (i%2){printf("#");continue; }printf("*");}printf("\n");}4.#include <stdio.h>int b=1;func (int p){static int d=5;d+=p;printf ("%d,",d);return (d );}main (){int a=3;printf("%d\n",func(a+func(b)));}5.#include <stdio.h>struct stu{ int num; char name[10]; int age;};void py(struct stu *p){printf("%s\n", (*p).name);}main(){struct stu student[3]={{1001,"Sun",25},{1002,"Ling",23},{1003,"Shen",22}}; py(student+2);}四、阅读程序或程序段,填空(每小题4分,共20分)1.下面程序的功能是调用fun函数以删除字符串中指定的字符,请填空。
void fun(char s[],int c){ int i,j;for(i=0,j=0;s[i]!='\0';i++)if ( ) s[j]='\0';}main(){ char str[]="abcdefgAbcd", ch;scanf("%c",&ch);fun(str,ch);printf("%s\n",str);}2.下面程序是按学生姓名查询其排名和平均成绩,查询可连续进行直到键入0时结束,请填空。
#include<string.h>#define NUM 4struct student{ int rank;char *name;float score;};stu[]={3,”Tom”,89.3,4,”Mary”,78.2,1, ”Jack”,95.1,2, ”Jim ”,90.6};main(){ char str[10]; int i;do{ printf("Enter a name: ");scanf("%s",str);for(i=0;i<NUM;i++)if ( ){ printf("%s,%d,%f\n",stu[i].name, stu[i].rank,stu[i].score); break;}if(i>=NUM) printf("Not found\n");}while(strcmp(str,”0”)!=0);}3.下面程序是用“顺序查找法”查找数组中的元素,请填空。