扬州大学C语言新生竞赛试卷2014
- 格式:doc
- 大小:66.50 KB
- 文档页数:15
C语言全部考试系统题库含答案第一章 C语言基础知识(C语言概述、算法、数据类型运算符表达式、位运算)一、判断题(正确的填A,错误的填B)R1.在C语言中,逗号运算符的优先级最低。
(A)2.在C语言可执行程序的开始执行点是程序中第一个函数。
(B)3.“5ch”是合法的变量名。
(B)4.C语言程序书写格式自由,一行内可以写几个语句,一个语句可以分写在多行上。
(A)5.当输入数据时,必须指明变量的地址,如scanf("%f",&f) (A)N6.表达式i++与++i在任何场合功能完全相同。
(B)7.在赋值表达式中,赋值号左边的变量和右边的表达式之值的数据类型可以不相同。
(A)R8.C语言程序中,语句以逗号结尾。
( B )9.在 C 程序中,APH 和aph 代表不同的变量。
( A )10. a-=7等价于a=a-7。
( A )N11. printf函数中用到格式符%5s ,其中数字5表示输出的字符串占用5列。
如果字符串长度大于5,则输出按原字符长从左向右全部输出。
(A )12.如果x>y为真或a<b为真,表达式(x>y)&&(a<b)就为真。
( B )13.C语言程序的变量必须先定义再使用。
( A )14.若a和b是同类型变量,在执行了赋值语句a=b;后b中的值将放入a中,b 中的值将丢失。
( B )15.程序的执行总是从main函数开始,在程序的最后一个函数中结束。
(B )16.变量的三个属性是指变量的名字、变量的值和变量在内存中的地址。
(A)17. 运算符优先顺序:赋值运算符<逻辑运算符<关系运算符<算术运算符(B)18.对应float类型的变量,也可以用等号“==”进行数值的判断。
(B)19.表达式:1 && 3.14 和 1 & 3 的值一样大。
(B)20. 为了正确计算表达式既要考虑运算符的优先级,也要考虑其结合性。
韩山师范学院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 总是与 __________ 配对。
2014National English Competitionfor College Students(Level C-Preliminary)参考答案及评分标准Part I Listening Comprehension(30marks)Section A(5marks)1—5CACBASection B(10marks)6—10CABDA11—15BABCASection C(5marks)16—20CBCBDSection D(10marks)21.get over22.preferred23.the same effect24.claim to be25.make sure 26.charges27.right away28.amount of time29.insurance company30.feel safe inPart II Vocabulary,Grammar&Cultures(15marks)31—35BBACB36—40DABCD41—45DBCABPart III Cloze(10marks)46.geese47.before48.survival49.shorter50.enormous51.flies52.against53.Navigation54.Amazingly55.whichPart IV Reading Comprehension(35marks)Section A(5marks)56.F57.T58.T59.T60.FSection B(10marks)61.F62.G63.B64.A65.DSection C(10marks)66.There are only three medical schools in Norway and it is difficult for her to find a chance.67.For six months.68.She wants to be a doctor.69.Almost all people in Munich drink beer.70.She did a part time job in a hospital near Oslo.Section D(10marks)71.creams72.harming/damaging73.reduce74.properties75.applied1--2--thoughtout people ’s rapidly a until √the grow it adjust Part V Translation (15marks)Section A (5marks)76.远程教育属于正规教育,它打破了传统的课堂教学模式。
NOIP2014初赛普及组C++题目及答案第二十届全国青少年信息学奥林匹克联赛初赛普及组C++语言试题2014年一、快单项选择题(共20题,每题1.5分,共计30分;每题有且仅有一个正确选项)⒈以下哪个是面向对象的高级语言( )。
A.汇编语言B.C++C.FortranD.Basic⒉1TB代表的字节数是( )。
A.2的10次方B.2的20次方C.2的30次方D.2的40次方⒊二进制数00100100和00010101的和是( )。
A.00101000B.001010100C.01000101D.00111001⒋以下哪一种设备属于输出设备( )。
A.扫描仪B.键盘C.鼠标D.打印机⒌下列对操作系统功能的描述最为完整的是( )。
A.负责外设与主机之间的信息交换B.负责诊断机器的故障C.控制和管理计算机系统的各种硬件和软件资源的使用D.将没有程序编译成目标程序⒍CPU、存储器、I/O设备是通过( )连接起来的。
A.接口B.总线C.控制线D.系统文件⒎断电后会丢失数据的存储器是( )。
A.RAMB.ROMC.硬盘D.光盘⒏以下哪一种是属于电子邮件收发的协议( )。
A.SMTPB.UDPC.P2PD.FTP⒐下列选项中不属于图像格式的是( )。
A.JPEG格式B.TXT格式C.GIF格式D.PNG格式⒑链表不具有的特点是( )。
A.不必事物估计存储空间B.可随机访问任一元素C.插入删除不需要移动元素D.所需空间与线性表长度成正比⒒下列各无符号十进制整数中,能用八位二进制表示的数中最大的是( )。
A.296B.133C.256D.199⒓下列几个32位IP地址中,书写错误的是( )。
A.162.105.135.27B.192.168.0.1C.256.256.129.1D.10.0.0.1⒔要求以下程序的功能是计算:s=1+1/2+1/3+...+1/10。
#include <iostream>using namespace std;int main(){int n;float s;s = 1.0;for(n = 10; n > 1; n--)s = s + 1 / n;cout << s << endl;return 0;}程序运行后输出结果错误,导致错误结果的程序行是( )。
2009-2013年NOIP初赛提高组C++语言试题2013第十九届全国青少年信息学奥林匹克联赛初赛提高组C++语言试题竞赛时间:2013年10月13日14:30~16:30选手注意:试题纸共有12页,答题纸共有2页,满分100分。
请在答题纸上作答,写在试题纸上的一律无效。
不得使用任何电子设备(如计算器、手机、电子词典等)或查阅任何书籍资料。
一、单项选择题(共15题,每题1.5分,共计22.5分;每题有且仅有一个正确选项)1.一个32位整型变量占用()个字节。
A.4 B.8 C.32 D.1282.二进制数11.01在十进制下是()。
A.3.25 B.4.125 C.6.25 D.11.1253.下面的故事与()算法有着异曲同工之妙。
从前有座山,山里有座庙,庙里有个老和尚在给小和尚讲故事:?从前有座山,山里有座庙,庙里有个老和尚在给小和尚讲故事:‘从前有座山,山里有座庙,庙里有个老和尚给小和尚讲故事....’?A.枚举B.递归C.贪心D.分治4.1948年,()将热力学中的熵引入信息通信领域,标志着信息论研究的开端。
A.冯·诺伊曼(John von Neumann)B.图灵(Alan Turing)C.欧拉(Leonhard Euler)D.克劳德·香农(Claude Shannon)5.已知一棵二叉树有2013个节点,则其中至多有()个节点有2个子节点。
A.1006B.1007C.1023D.10246.在一个无向图中,如果任意两点之间都存在路径相连,则称其为连通图。
右图是一个有5个顶点、8条边的连通图。
若要使它不再是连通图,至少要删去其中的()条边。
A.2B.3C.4D.57.斐波那契数列的定义如下:F1=1,F2=1,Fn=Fn–1+Fn–2(n≥3)。
如果用下面的函数计算斐波那契数列的第n项,则其时间复杂度为()。
int F(int n){if(n<=2)return 1;elsereturn F(n-1)+F(n-2);})A.O(1)B.O(n)C.O(n2)D.O(Fn8.二叉查找树具有如下性质:每个节点的值都大于其左子树上所有节点的值、小于其右子树上所有节点的值。
第一章程序设计与C语言1.1 选择题考点:标识符的命名规则(1)只能由字母、数字、下划线构成(2)数字不能作为标识符的开头(3)关键字不能作为标识符选项A中的“-” ,选项B中“[”与“]”不满足(1);选项D中的int为关键字,不满足(3)1.下列正确的标识符是(C)。
A.-a1B.a[i]C.a2_iD.int t2.下列C语言用户标识符中合法的是(B)。
A)3ax B)x C)case D)-e2 E)union选项A中的标识符以数字开头不满足(2);选项C,E均为为关键字,不满足(3);选项D中的“-”不满足(1);3.下列四组选项中,正确的C语言标识符是(C )。
A)%x B)a+b C)a123 D)123选项A中的“%” ,选项B中“+”不满足(1);选项D中的标识符以数字开头不满足(2)4.下列四组字符串中都可以用作C语言程序中的标识符的是(A )。
A、print _3d db8 aBcB、I\am one_half start$it 3paiC、str_1 Cpp pow whileD、Pxq My->book line# His.age选项B中的“\”,”$” ,选项D中“>”,”#”,”.”,”-”不满足(1);选项C中的while为关键字,不满足(3)知识点:简单C语言程序的构成和格式5.在一个C程序中___B___。
A、main函数必须出现在所有函数之前B、main函数可以在任何地方出现C、main函数必须出现在所有函数之后D、main函数必须出现在固定位置6.以下说法中正确的是__D____。
A、#define和printf都是C语句B、#define是C语句,而printf不是C、printf是C语句,但#define不是D、#define和printf都不是C语句7.一个C程序的执行是从(A )。
A本程序的main函数开始,到main函数结束B本程序文件的第一个函数开始,到本程序文件的最后一个函数结束C本程序的main函数开始,到本程序文件的最后一个函数结束D本程序文件的第一个函数开始,到本程序main函数结束8.在C 语言中,每个语句必须以(D )结束。
2011 National English Contest for College students(Level C-Preliminary)Part I Listening Comprehension (30 marks)Section A (5 marks)In this section, you will hear five short conversations. Each conversations will be read only once. At the end of each conversation, there will be a twenty-second pause, read the question and the there choices marked A,B and C ,and decide which is the best answer.Then mark the corresponding letter on the answer sheet with a single line through the centre.1.What does the man want to do?A.Get something to eat now.B.Find a quiet place that shows games.C.Watch the next game with the woman.2.Why does not the man have a MySpace account?A.He is not skilled at using computer.B.All of the instruction are in EnglishC.The woman won not teach him.3.How long does the woman plan to try teleworkingA.For a few days.B.For a few weeks.C.For a few months.4.What does the man hope will happen?A.The price of cell phone novels will go down.B.The novel’s author will writer longer stories.C.The woman will tell him ho the story ends.5.what is the woman going to do next?A.turn on her computer.B.Go for a walk with peter.C.Visit her new neighbors.Section B (10 marks)In this section, you will hear two long conversations. Each conversation will be read only once. At the end each conversation, there will be a one minute pause. During the pause, read the questions, each with three choices marked A, B and C, and decide which is the best answer. Then mark the corresponding letter on the answer sheet with a single line through the centre. Conversation one6.What did Jack do over the summer?A.He studied very hard.B.He took a summer class.C.He visited one of his teachers.7.What does Jack think of Ms Wellington as a teacher?A.Easy-going.B.Tough.C.Interesting.8.Why is Ms Wellington’s class har d?A.Her exams are difficult.B.She does not give students the help they need.C.She makes do lots of work.Conversation two9.Why is Mrs. Griffin going to the city where the hotel is located?A.He is on holiday.B.He’s on a business tripC.He is going to a conference.10. How many times has Mrs. Griffin stayed at the Sunrise Hotel?A. Twice.B. Once.C. Three times.11. Where is Mrs. Griffin form?A. Canada.B. New Zealand.C. Australia.12. What is Mrs. Griffin’s passport number?A.87647489B.87637289C.8763748913. What kind of room does Mrs. Griffin want?A. A single room for two nights.B. A double room for two nights.C. A single room for one night.14. When will Mrs. Griffin arrive at Sunrise Hotel?A. at 9:15 pmB. at 9:35 pmC. at 10:00 pm15. What food will b e put into Mrs. Griffin’s room?A. a sandwich with fries.B. a cheese sandwich.C. a burger with chips.Section C (5Marks)16. What does the Associated Press ask editor and news directors to do?A. vote for the top stories of the year.B. describe the oil spill in the Gulf of MexicoC. writes about the 11 workers killed in the explosion17. Where are the doctors and technology experts from?A. New York.B. LondonC. Tokyo18. For how long does President Obama agree to extend the tax cuts?A. for four yearsB. for three yearsC. for two years.19. How many people in the world don’t have enough to eat,according to the report?A. more than one billion.B. some six hundred million.C. nearly nine hundred million20. What have astronomers recently discovered?A. there are unknown plants in older galaxies.B. there are many galaxies in the universeC. there are a lot more red dwarf in older galaxiesSection D (10 marks)In the section, you will hear a short passage. There are 10 missing words phrases. Fill in the blanks with the exact words or phrases you hear. Remember to write the answer on the answer sheetWhat do you do if you don’t get your first choice university? This ____ faces thousands of British every year. Many such_____ turn to Clearing, a service that helps find university places for students at the last moment. If they don’t have the marks to get into their____, Clearing tells them about places available at other university, though they might have to read a difficult subject.This year has seen a record number of people applying to university. This, combined with the _____________________,an uncertain job market, and budget cuts at university, product even more of a scramble for places than usual. Some sources say six students have applied for each remaining___________________________ placeThe British University Admissions Service, UCAS, says up to a quarter of this year’s university applicants-almost 190000 people-have not been admitted intoa____________________________. That is an increase of over 46000 students from last year.Faced with these figure, some British students might consider an interesting alternative:_____________________________. The University of Nottingham for is offering place at its campuses in Ningbo, near Shanghai, and Kuala Lumpur, Malaysia. Students at these institutions can earn University of Nottingham degrees, according, engineering and English. Similarly, the University of Bolton says it has unlimited places at its campus in the United Arab Emirates.To deal with t hese problems, the UK’s Higher Education Minister, David Willet’s, is encouraging students who have not made the grade to consider alternatives to university, such as_______________________and studying at home.“There are arrange of options available, “he says. “people can reapply next year, so they should consider spending this year in a way that will add positively to their CVs. Getting_____________________or other skills will strengthen their chances next year.” Some commentators say, though that rising university costs, poor long-term_______________________, and a drop in graduate recruitment mean this the worst time to be a university student in the UK.Part Two Vocabulary and Structure (15 marks )There are 15 incomplete sentences in this section. For each blank there are four choices marked A, B, C and D. Choose the one that best completes the sentence. Then mark the corresponding letter on the answer sheet with a single line through the centre.31.After four days of talks, we are glad to announce that the union and management have reached an____A__. The agreement is fair and benefits both sides.A.accordB. accomplishmentC. identityD. undertaking32.As the clerk__B___prepared my milk shake, I wondered how long she had been working there ,mindlessly making ice cream treats in a set order of steps.A.logicallyB. methodicallyC. graphicallyD. synthetically33. As a boy he wanted to be a fireman. As a high school student, he thought he'd like to become a teacher. Now he___C___to be nothing more than a janitor.A.AssumesB. PrescribesC. AspiresD. Presumes34. Regardless of what caused it, I an grateful that have finally reached a point in mylife__B_____I can appreciate my strengths, accept my weaknesses and try to be comfortable with everything in between.A.WhyB. WhereC. WhichD. What35. _C_____information provided by members of the public, the police would have a much move difficult job.A.SupposingB. Provided theC. If it were not forD. On condition that36.Peter Brown was a painstaking writer;_D___, he once spent half a day on the composition of a single sentence.A.On the other handB. NeverthelessC. MoreoverD. For example37.----What an I going to do about a present for Carol?----You_C_____some flowers.A.Might have sent herB. Must have sent herC. Could send herD. Would send her38.Without the air holding in some of the sun's heat, the earth_B_____cold at night, too cold for us to live on.A.Will be freezingB. Would be freezingC. An be frozenD. Would be frozen39.The students in our university each__A____an English dictionary. That is to say, each of the students in our university______an English dictionary.A.Have; hasB. Have; haveC. Has; haveD. Has; has40.Here's your kitchen. I hope you enjoy cooking here. Is there__B____else that you need?A.SomethingB. AnythingC. NothingD. Everything41.David_____C_his business partner over plans to reduce the workforce.A.Came down toB. Broke down toC. Fell out withD. Went along with42.___A___is this piece of equipment to be removed from the building.A.On no accountB. AbsolutelyC. ScarcelyD. Not at all43.Helen' s parents were_C_____that she was still on the job., but she had resigned.A.In doubtB. Of the opinionC. Under the impressionD. With suspicion44.----I don't think I will ever, in my life, win a lottery of five million dollars.----Well, _____D. Anything can happen.A.You made itB. You're kiddingC. What you sayD. You can never tell45.-----How did you find the concert in the Grand Theatre last night?-----____B__ but the conductor was perfect.A.I couldn't agree moreB. I didn't think much of itC. I was crazy about itD. I really likedPart Three Cloze(15 marks )I have been reading a lot on my iPad recently, and I have some (46)____complaints_ (complain) not about the iPad itself but about the state of digital reading generally. Reading is a subtle thing,and its subtleties are artifacts of a venerable medium: words printed in ink on paper. Glass and pixels aren't the same.When I read a physical book, I don't have to look anywhere else to find out how much I've read. The iPad e---reader, iBooks tries to create the (47) illu___remain of a physical book. The pages seem to turn, and I can the edges of those that remain, but it's fake. There are always exactly six unturned pages, no matter (48)____where_ I am in the book.Also, there is a larger problem. Books in their digital format look vastly less "finished", or less genuine than real books. You can vary their font and type size, but this only makes them(49)___resemble_(resemble) word---processed---no matter how (50)wretched___(wretch) or wonderful they are---will never look as good as Robert Hass's poems in the print edition of The Apple Trees at Olema. But your poems can look almost exactly as ugly---as "e---book---like" ---as the Kindle version of that collection.All the e---book I've read have been ugly---books by Chang---rae Lee, Alvin Kernan, and Stieg Larsson---though the texts have been wonderful. I didn't grow up reading texts. I grew up reading books, and this(51)___difference__(differ) is important.When it comes to digital editions, the(52)_assumption____(assume) seems to be that all books(53)are___created_ _(create) equal. However, nothing could be further from the truth. In the mass migration from print to digital, we're seeing a profusion of digital books---many of them out of copyright---that look new and even "HD," but which may well have been supplanted by more accurate editions and better translations. We need a digital readers' guide---a place where readers can find(54)__out__ whether the book they're about to download is the best available edition.(55)Fi__nally___, two related problems. I already have a personal library, but most of the books I've read have come from(56)__lending___(lend) libraries. Barnes & Noble has released ane---reader that allows short---term (57) ____borrowing_(borrow) of some books. The entire idea behind Amazon's Kindle and Apple's iBooks assumes that you cannot read a book unless you own it first and that only you can read it unless you want to give your reading device to someone else. This goes against the social value of reading, the collective knowledge and(58)___collaborative__(collaborate) discourse that comes from access to (59)__shared_or our culture in general.Part Four Reading Comprehension (40 marks).Section A (10 marks ).Questions 61 to 65 are based on the following passage.Not keen on reading? Do you have trouble finding a novel that arouses your interest? Why not follow Ammon Shea's example and start reading a dictionary?Mr Shea owns over 1,000 dictionaries and he reads them for fun. He recently spent a year reading all 20 volumes of the Oxford English Dictionary. The dictionary contains more than20,000 pages and over 59 million words.As he read from A to Z, he noted down interesting words in a ledger. This includes words such as "happify," meaning to make someone happy and "tripudiate", which means to dance, skip or leap for joy. Mr Shea also kept a diary about this experience, which has since become abest---selling book.Why did he do this? He claims it was fun. "I've always enjoyed reading dictionaries . They are far more interesting than people give then credit for," he said.It appears that it was not his goal to sound more intelligent by using longer and more complex words. "I'm not against long, fancy or obscure words, but I'm opposed to using then for their own sake," he said.In fact ,as a result of reading so many new words , Mr Shea often forgot everyday vocabulary. He wrote, "My head was so full of words that I often had trouble forming simple sentences."Mr Shea is not alone in his love of reading dictionaries.Elaine Higgleton, a representative of Collins Cbuild dictionaries, explained that thousands of crossword puzzle and Srabble fans read dictionaries for fun and to improve their games. Ms Higgleton did however note that, "It's probably not the best way to learn English ,and you'd learn more than you need." It is not known how many of the 59 million words Ms Shea remembers, but he has certainly made history with his eccentric hobby.Questions 61 to 65.Decide whether the following statements are True or False.61.Mr Shea has read 1.000 dictionaries.F62.Mr Shea spent one month reading the Oxford English Dictionary.F63.In Mr Shea's opinion,people don't give dictionaries enough credit for being interesting.T64.Mr Shea thinks it is important t be able to use long and complicated words in everyday conversation.F65.Elaine Higgleton thinks that reading a dictionary is the best way to learn English.FSection B (10 marks)Questions 66 to 70are based on the following passage.Surfing is something people often get hooked on after trying it a few times. For many surfers it is much more than a hobby---they would probably agree with the American professional surfer Kelly Slater when he said,"Once you're in, you're in. There's no getting out.""Surfing", of course, refers to riding on ocean waves using a surfboard. Many surfers stand up on their boards, which requires god balance and is therefore difficult for most beginners to learn, but some lie down and "bodyboard"The history of surfing probably began with the Polynesian people of the Pacific Islands. One of the first white people to see anyone surfing was the British explorer Captain Gook, when his ship arrived in Hawaii in 1779. He watched many Hawaiians riding waves on large pieces of wood, and reported that, "Surfing seems to give them a feeling of great pleasure. "When surfing started to become very popular in the United States in the 1950's and 60s, surfers used large wooden boards (often more than three metres long) that were quite heavy. Boards today are shorter and also much lighter, because they are made of artificial materials instead of wood. For anyone who wants to try surfing. The only essentials are waves and a board. There are a few other things, however, that most surfers find important; a cord t attach one of their ankles to the board and therefore stop it from being carried a long way away when they fall off'; wax, which they put on the surface of the board to help their feet stick to it; and a wetsuit to help them keep warm in cold water. The south---west of English is an example of a place where surfers usually need wetsuits, even in summer.Surfing has been a professional sport for many yeara and the very best surfers are able to makea living from it. Most of the best professional surfers in the last 30 years, both men and women, have been American or Australian, but surfers from Brazil, Peru and South Africa have also won important competitions.Questions 66 to 70Answer the following questions with the information given in the assage in a maximum of 10 words for each question.66.Why do most beginners find it difficult t stand up on a surfboard?Because standing up on their boards requires god balance .67.In what part of the world did surfing probably begin?The Polynesian people of the Pacific Islands.68.When did surfing start to become very popular in the United States?In the 1950's and 60s69.What do surfers use wax for?To help their feet stick to the board70.According to the passage, in what part of the world do surfers usually need wetsuits?In the southwest of EnglandSection C (10 marks)Questions 71 to 75 are based on the following passage.The latest human development report from the United Nations Development Programmed (UNDP) contains some good news, but also a very serious warning about the threat posed y climate change.The report, published annually since 1990, seeks to asses “human development” around the world, and calculates a “Human Development Index (HDI) for 169 counties. The HDI is based on average income, life expectancy and level of education in a country. Not surprisingly, rich counties tend to have higher HDIs than poor counties, but there are interesting variations in human development among countries with similar levels of economic development, because some have better health and education systems than others.According to the 2010 report, the county with the highest level of human development is Norway, followed by Australia, New Zealand, the United States and Ireland. Most of the lowestHDIs belong to counties in sub-Saharan Africa.Almost all counties around the worlds have higher HDIs now than in 1990, despite the fact that since the 2008 financial crisis, the total number of people living in extreme poverty has increased. The report concludes that most people are healthier, live longer, are better educated and have access to more goods and services. Even in countries with severe economic problems, people’s level of health and education as generally improved. Although sub-Saharan African countries are at the bottom of the pile in terms of human development, some of them have made significant progress since 1990. The report is critical, however, of the fact economic inequality has increased significantly in the last twenty years, both within and between countries.The greatest threat to improving HDIs in the future, according to the report, is climate change. Economic growth increases average incomes in a country through increasing production and consumption. However , if this leads to greater emissions of greenhouse gases, as has always been the case in the past, global warning will probably accelerate, and cause severe environmental problem s in some parts of the world hat will threaten the livelihoods of huge numbers f people. The progress of the last twenty years, therefore, might not be sustainable.The only solution, according to the report, I to break the link between economic growth and greenhouse gas emissions-which, needless to say, is easier, said than done.Questions 71 to 75Complete the following sentences with information given in the passage in a maximum of 10 words for each blank.71. The concept of “human development” is based on the following three factors: _____ average income, ____ life expectancy _______and___ level of education72. Some countries with similar levels of economic development have quite different HDIs because they have_______ better health and education systems than others.______.73._______________ The financial crisis,__has caused the number of people living in extreme poverty to increase since 2008.74. The report says that _______ climate change______ is the greatest threat to increasing HDIs in the future.75. The report says the link between_____ economic growth _____ and ________ greenhouse gasemissions-____needs to be broken.Section D (10 marks)Questions 76 to 80 are based on the following passageIt is natural for young people to be critical of their parents at times and to blame them for most of the misunderstanding between them. They have always complained, more or less justly, that their parents are out of touch with modern ways; that they are possessive and dominant; that they do not trust their children to deal with crises: that they talk too much about certain problems-and that they have no sense o humor, at least parent-child relationships.I think it is true that parents often underestimate their teenage children and also forget how they felt themselves when were young.Young people often irritate their parents with their choices in clothes, hairstyles, entertainers and music. This is not their motive. They feel cut off from the adult world into which they have not yet been accepted, so they create a culture and society and their own. Then, if it turns out that their music, entertainers, vocabulary, clothes or hairstyles irritate their parents, this gives them additional enjoyment. They feel they are superior, at least in a small way, and that they are leaders in style and taste.Sometimes teenagers are resistant and proud because they do not want their parents to approve of what they do. If they did approve, it looks as if the teenager is betraying his own age group. All this is assuming that the teenager is the underdog: he can not win but at least he can keep his honor. This is a passive way of looking at things. It is natural enough after years of childhood, when children were completely under their parent’s control, but it ignores the fact that when they become teenagers, children are beginning to be responsible for themselves.If you plan to control your life, co-operation should be a part of that plan. You can charm other people, especially your parents, into doing things the way you want. You can also impress people with your of responsibility and your initiative, so that they will give you the authority to do what you want to do.Questions 76 to 78Choose the best answer according to the passage.76 the first paragraph is mainly about______A_______.A teenagers’ criticism of their parentsB misunderstanding between teenagers and their parentsC the dominance of parents over their childrenD teenagers’ ability to deal with crises77 teenagers have strange clothes and hairstyles because they____B_______A have a strong desire to be leaders in style and tasteB want to prove their existence by creating a culture of their ownC have no other way to enjoy themselvesD want to irritate their parent78 teenagers do not want their parents to approve of what they do because they_____D__________.A have already been accepted into adult worldB feel that they are superior to adult worldC want to win adults over to their cultureD don’t want to appear to be disloyal to their own age groupQuestion 79 to 80Translate the sentences in the passage into Chinese79 I think it is true that parents often underestimate their teenage children and also forget how they felt themselves when were youn我认为父母经常低估他们十几岁的孩子,同时也忘记他们年轻时候的感受。
200606参考答案一、单选题(每小题2分,共30分)二、填空题(每空1分,共20分)(1)函数(2)分号或;(3)顺序(4)循环或重复(5)sqrt(x*x+y*y)/(a+b)(6)math.h(7)自动或auto(可与8互换)(8)静态或static (9)0(10)7(11)无返回值(12)静态局部或静态内部(13)# (14)编译前(15)自引用结构(16)struct node * (17)auto(18)int 或整(19)11(20)3二、阅读程序写出结果(每小题4分,共20分)1. 9 2 . 1,100 3. 3 5 7 4. 4,25. 4321三、完善程序题(每空1分,共30分)(1)n%10 (2)n=n/10 (3)n%8或n%base(4)n=n/8或n=n/base (5)c[i] (6)fabs(term)>1e-6 或fabs(term)>=1e-6 (7)-x*x/(n*(n+1)) (8)mycos(x) (9)j=1(10) y>0 或y>=1 (11) y-- (12) ling int num或long num(13)char name[11] (14)struct date birthday (15)p->link=q或(*p).link.h (16)q->link或(*q).link (17)s1[n]!=cs[0][i] (18)i>=10或i>9或i==10 (19)cs[1][i] (20)ts,td (21) i=0(22)b[i]==y 或等价表示(23)i<20或等价表示(24)p1++或*p1++(25)*p1=*p2 (26)p (27)k=i(28)i+1或k+1或i或k(29)x[k].x==x[j].x (30)k!=i 或i<k200706参考答案单选题(每小题2分,共30分)(1)~(5)(6)~(10)(11)~(15)二、填空题(每空1分,共20分)(1)main (2)/*…*/ (3)#include或include (4)连接2个字符串(5)fabs(x-y)/sqrt(a*b+c*d)(6)math.h(7)值传递或单向值传递(8)首地址(9)0(10)5(11)无返回值(12)静态局部或静态内部(13)x<y&&y<z(14)99 (15)auto 或自动(16)int 或整(17)6(18) 6(19)自引用结构(20)struct node *三、阅读程序写出结果(每小题4分,共20分)1. 30 2 . a=1, b=10 3. 1 3 6 104. ***#5. 987四、完善程序题(每空1分,共30分)(1)k/10(或k=k/10)(2)s==5 (3)x(4)i-- (5)i或i!=0或i>0 (6)2*x*x*x-4*x*x+3*x-6(7)fabs(f(r))>0.001 (8)r=(m+n)/2 (9)n%2+’0’(10) n/2 (11) x[i]!=y[i]或其等价表示(12) DecToBin(a,m)(13)DecToBin(b,n) (14)Hymin(a,b) (15)&x(16)x>=0 (17)x>max 或max<x或各加上等于(18)x<min或min>x或各加上等于(19)chanr name[10] (20)char sex (21) struct date birthdate(22)p->link=q或(*p).link=q (23)q->link或(*q).link(24)p1++(25)*p2 (或*p1=*p2) (26)p (27)compress(s)(28)*q==*p (29)p+1, q (或strcpy(p+1,q))(30)return n或return (n)五、程序设计题(附加题,必须做!!每小题10分,共20分)1.源程序清单main(){ int n,a,b,c;for(n=1; n<1000; n++){ a=n/100; b=n/10%10; c=n%10;if(n/11==a*a+b*b+c*c&&((a==b)+(a==c)+(b==c))>=1)printf(“%5d”,n); }}2.#include<conio.h>void hailstones(int n){ int i=0;while(n!=1){ if(i%6==0) printf(“\n”);printf(“%5d”,n);if(n%2==0)n/=2;else n=3*n+1;i++; }printf(“%5d\n”,n);printf(“Number of hailstones generated:%5d\n”,i+1); }main(){ int n; printf(“Hailstones generated by “); scanf(“%d”,&n); hailstones(n);}。
A卷2013—2014学年第2学期《计算机程序设计C(2-2)》期末考试试卷专业班级姓名学号开课系室计算机应用技术系考试日期 2014年6月22日题号一二三总分得分阅卷人一、程序阅读题(每空2分,共20分)1.又是一年一度的毕业季,马上要离开校园踏上工作岗位的同学们在拍摄完照片之后,大家有了一个共同的想法——那就是在毕业前互换礼物。
到了约定的日子,同学们带来的礼物琳琅满目,都不知道该如何交换了。
于是,在经过讨论后一致决定,大家将n个礼物放在一起统一编号为1,2,……,n,并同时对该礼物的拥有者进行相同编号。
交换的规则是:1号同学与n号同学的礼物互换,2号同学与n-1号同学的礼物互换,以此类推。
请阅读下面程序并完成填空。
#include <stdio.h>#define N 120 + 1int main( ){int a[N] = {0},n,i,j,t;scanf("%d",&n);for( i = 1; i <= n; i++ ){【1】;}for( i = 1, 【2】 ; 【3】 ; i ++, j-- ){t = a[i];a[i] = a[j];a[j] = t;}for( i = 1; i <= n; i ++ ){printf("%d ",a[i]);}printf("\n");return 0;}2.下面函数的功能是统计字符串substr在字符串str中出现的次数,请阅读下面程序段并完成填空。
int count(char str[], char substr[]){int i,j,k,num=0;for (i = 0; str[i] != '\0'; i ++){【4】;for(j = 0; substr[j] != '\0'; k ++,j ++){if(【5】){break;}}if(substr[j] == '\0'){num ++;}}【6】;}13.在Windows操作系统中的“复制-粘贴-重命名”功能,可以实现将文件从一个位置复制粘贴到另外一个位置。
扬州大学信息工程学院 2014级新生C 语言竞赛试卷一、单项选择题(共10分,每题1分) 注意:在下列每小题的四个备选答案中选出一个正确的答案,并将其字母标号填入题后的括号内。
1.下列表达式中,错误的是( )。
A .4.0%2.0 B. k+++j C. a+b>c+d?a:b D. x*=y+30 2.设有说明“int x,y,z,m=10,n=5;”,执行下面三个语句: x=(--m==n++)?—m:++n; y=m++; z=n; 则x 、y 、z 的值分别是( )。
A .7、9、7 B .5、9、7 C .6、1、5 D .10、11、10 3.设有说明“int x=1,y=1,z=1,c;”,执行语句“c=--x&&--y||--z;”后,x 、y 、z 的值分别是( )。
A .0、1、1、 B .0、1、0 C .1、0、1D .0、0、1 4.以下常量中正确的是( )。
A .’abc’ B .’\x123’ C .3.15E-1.2 D .”a” 5.以下不致造成死循环的语句是( )。
A .for(y=0,x=1;x>++y;x=i++) i=x; B .for(; ;x+=i); C .while(x=8) x--; D .for(i=10,sum=0;sum<=i;) sum=--i;6.设有以下函数定义,则返回的函数值是()。
int *fun(int *a){ int *t;*a=99;t=a; return t;}main(){ int x,*y ,*fun(int*);y=fun(&x) ;...}A.无确切的值B.形参a的地址C.主程序中变量x的地址D.函数fun中变量t的地址7.设有数组说明“int a[4][4];”则不能等价表示数组元素a[3][3]的是()。
A.*(a[3]+3) B.*(*(a+3)+3) C.*&a[3][3] D.(*(*(a+3))+3) 8.设有说明“char *str=”\t\’c\\Language\n” ;”,则指针str所指向字符串的长度是( )。
A. 17B.13C.15D. 非法说明9.设有说明:struct{ char name[15],sex;int age; float score;}stu,*p=&stu;则以下不能正确输入结构体成员值的是()。
A.scanf(“%c”,&p->sex); B.scanf(“%s”,);C.scanf(“%d”,&stu.age);;D.scanf(“%f ”,p->score); 10.设有“char s[ ]=”Program”,*p=s;”,则以下叙述中正确的是()。
A.数组s的内容与指针变量p中的内容相同B.数组s的长度与strlen(p)的值相等C.p[5]的值等于s[5]的值D.sizeof(s)等于sizeof(*p)二、填空题(共10分,每题1分)1.若有定义语句“static char str[4][20]={“thank”,”you”,”very”,”much!”};”,则数组str中存储’\0’的数组元素有个。
2.在C语言中,当关系表达式中的关系成立时,则该关系表达式的值是。
3.下列程序是求1到100的累加和,其中有3个能够完成规定的功能;有1个所完成的功能与其他程序不同,它是程序段。
A. s=0;i=0;while(i<=100) s+=i++;B. s=0;i=1;while(i++<100) s+=i;C. s=0;i=0;while(i<100) s+=++i;D. s=0;i=0;while(++i<=100) s+=i;4.若二维数组a有m列,则数组元素a[i][j]在数组中的位置是,在a[i][j]前的元素个数是。
(假设a[0][0]位于数组的第一个位置上)5.若有说明:int a[][3]={1,2,3,4,5,6,7};则a数组第一维的大小是。
6.若用数组名作为函数调用的实参,传递给形参的是。
7.凡是在函数中未指定存储类别的局部变量,其隐含的存储类别是。
8.若有说明:int a[5][6],*p=a[0],(*q)[6]=a,则数组元素a[i][j]的指针可表示为p+____ ___;*(*(q+i)+j)表示。
9.以下与库函数strcpy(char *p1,char *p2)功能不相同的程序段是。
A. strcpy1(char *p1,char *p2){ while((*p1++=*p2++)!=’\0’); }B. strcpy2(char *p1,char *p2){ while((*p1=*p2)!=’\0’) p1++,p2++; }C. strcpy3(char *p1,char *p2){ while (*p1++=*p2++); }D. strcpy4(char *p1,char *p2){ while(*p2) *p1++=*p2++ ; }10.下面程序的运行结果是。
main(){ struct cmplx{ int x;int y;}cnum[2]={1,3,2,7},*p=&cnum[0] ;printf(“%d\n“,cnum[0].y/cnum[0].x*(++p)->x);}三、阅读程序(共20分,每题4分)1.试写出下列程序运行结果。
#include <stdio.h>void fun(int *a,int b,int *c){ *a=++b;b=*c;*c=*a;}void main( ){ int a=100,b=200,c=300;{ int a=4;c=a+b;printf("%d\n", a+b+c);{ int c=b;fun(&a,b,&c);printf("%d\n",a+b+c);}printf("%d\n", a+b+c);}}【结果】2.试写出下列程序运行结果。
#include <stdio.h>void f(int *p,int n){ int i,j;for(i=0;i<n;i++)for(j=i+1;j<n;j++)if(p[i]&&p[j]&&(p[j]%p[i]==0)) p[j]=0; }void main(){ int a[28],i,j=0;for(i=0;i<28;i++) a[i]=i+2;f(a,28);for(i=0;i<28;i++)if(a[i]) { printf("%d\t",a[i]);if(++j%5==0) printf("\n");}}【结果】3.假设整型数据的内存字节数为2,再假设以下程序的第一个printf语句的输出为ffe2,试写出下列程序运行结果。
#include <stdio.h>void main( ){ static int a[]={1,2,3,4,5,6,7,8,9,0},*p=a;printf(“%x\n”,p) /*输出结果设为ffe2*/printf(“%x\n”,p+9);printf(“%d\n”,*p+9);printf(“%d\n”,*(p+9));printf(“%d\n”,*++p+9);}【结果】4.试写出下列程序运行结果。
#include <stdio.h>void main(){ static int sq[3][3]={0};int i,j,k;i=1,j=2;sq[i][j]=1;for(k=2;k<=9;k++){ i++,j++;if(i>2&&j>2) i--,j-=2;else if(i<=2&&j>2) j=0;else if(i>2&&j<=2) i=0;else if(i<=2&&j<=2&&sq[i][j]!=0) i--,j-=2;sq[i][j]=k;}for(i=0;i<3;i++){ for(j=0;j<3;j++) printf("%5d",sq[i][j]);printf("\n");}}【结果】5.试写出下列程序运行结果。
#include <stdio.h>struct s{ int n,*m;}*p,*q;int d[5]={10,20,30,40,50};struct s arr[5]={{100,&d[0]},{200,&d[1]},{300,&d[2]},{400,&d[3]}, {500,&d[4]}};main( ){ q=p=arr;printf(“%d\n”,++p->n); p++;printf(“%d\n”,p++->n);printf(“%d\n”,++(p->m));q+=3;printf(“%d\n”,q->m);}【结果】四、完善程序(共20分,每空2分)1.函数insert()有三个参数:第一个参数是一个指向数组的指针;第二个参数指明数组的大小;第三个参数是要插入数组中的一个数。
设数组中的数据已按升序排序。
该函数的功能是:首先采用折半查找的方法,找出要插入数据的位置;然后按升序将数据插入该数组中。
主函数输出已插入数据后的数组的各元素值。
#include <stdio.h>void insert(int *p,int size,int a){ int low,high,mid,n;low=0,high=size-2;mid=(low+high)/2;while(low<mid){ if(a<*(p+mid)) high= (1);else low= (2);mid=(low+high)/2;}printf(“low=%d high=%d\n”,low,high);if(*(p+high)<a) high++;for(n=size-1;n>high;n--) *(p+n)= (3);*(p+high)=a;}main(){ int i,j;int a[11];for(i=0;i<10;i++) a[i]=3*i;printf(“Input a number!”);scanf(”%d”,&j);insert(a,11,j);for(i=0;i<11;i++) printf(”%4d”,a[i]);printf(”\n”);}2.下面程序将十进制整数转换成n进制。