Answers to Selected Problems
- 格式:pdf
- 大小:72.08 KB
- 文档页数:6
解决问题的秘诀的英文作文Title: The Secret to Problem Solving。
Problem-solving is an essential skill that we all need in various aspects of life. Whether it's overcoming personal challenges, tackling complex issues at work, or finding solutions to global problems, the ability to effectively solve problems is invaluable. So, what is the secret to successful problem-solving?First and foremost, problem-solving requires a clear understanding of the issue at hand. Before diving into finding solutions, it's crucial to define the problem accurately. This involves breaking down the problem intoits essential components, identifying any underlying causes or factors contributing to it, and understanding the context in which it exists. Without a thorough understanding of the problem, any attempts at finding a solution are likely to be ineffective or even counterproductive.Once the problem is clearly defined, the next step isto generate possible solutions. This often involves brainstorming ideas, thinking creatively, and considering various perspectives. It's essential to explore a widerange of options, even those that may seem unconventionalor unlikely at first glance. Sometimes, the most innovative solutions arise from thinking outside the box.After generating a list of potential solutions, thenext step is to evaluate each one critically. This involves assessing the feasibility, effectiveness, and potential consequences of each solution. It's essential to weigh the pros and cons carefully and consider how each option aligns with the desired outcome. Additionally, seeking input from others can provide valuable insights and perspectives that may not have been considered initially.Once the options have been evaluated, the mostpromising solution can be selected and implemented. However, the process doesn't end there. Problem-solving is often an iterative process, and it's essential to monitor theimplementation of the chosen solution closely. This involves tracking progress, gathering feedback, and making adjustments as needed. Flexibility and adaptability are key qualities in successful problem-solving, as unexpected challenges or obstacles may arise along the way.Another crucial aspect of effective problem-solving is collaboration. Rarely do we solve problems in isolation, and working with others can lead to more robust solutions. Collaboration allows for the pooling of diverse skills, knowledge, and perspectives, leading to more comprehensive problem-solving outcomes. Additionally, involving stakeholders in the problem-solving process fosters buy-in and support for the chosen solution.Furthermore, maintaining a positive attitude and mindset is essential for successful problem-solving. Challenges and setbacks are inevitable, but approaching them with optimism, resilience, and determination can make all the difference. Instead of viewing obstacles as insurmountable barriers, see them as opportunities for growth and learning. Embracing a solution-focused mindsetempowers us to overcome adversity and find creative ways to address even the most daunting problems.In conclusion, the secret to successful problem-solving lies in a combination of factors: understanding the problem, generating innovative solutions, critically evaluating options, implementing the chosen solution, collaboratingwith others, and maintaining a positive mindset. Byfollowing these principles and approaches, we can navigate challenges effectively and achieve meaningful outcomes in both our personal and professional lives.。
c语言程序设计教程第二版课后答案【篇一:c语言程序设计(第2版)-- 课后题答案】p> 参考答案第1章进入c语言程序世界二、1.i love china!printf(we are students.\n)2.6项目实训题参考答案1.编写一个c程序,输出以下信息:* * * * * * * * * * * * * * * * * * * *i am a student!* * * * * * * * * * * * * * * * * * * *main(){ printf(********************\n);printf( i am a student!\n);printf(********************\n);}2.已知立方体的长、宽、高分别是10cm、20cm、15cm,编写程序,求立方体体积。
解:main(){int a,b,c,v;a=10;b=20;c=15;v=a*b*c;printf(v=%d,v);}本程序运行结果为:v=3000第2章编制c程序的基础知识一选择题c b a b a c c二操作题,2,-8,23.000000,2.500000,-8.0000002. abc defghwhy is21+35equal 523.34214. aaa项目实训题1.定义一个符号常量m为5和一个变量n值为2,把它们的乘积输出。
#define m 5main(){ int n,c;n=2; c=m*n;printf(%d\n,c);}2.编程求下面算术表达式的值。
(1)x+a%3*(int)(x+y)%2/4,设x=2.5,a=7,y=4.7;(2)(float)(a+b)/2+(int)x%(int)y,设a=2,b=3,x=3.5,y=2.5。
(1)main(){ int a=7;float x=2.5,y=4.7;printf(%f\n,x+a%3*(int)(x+y)%2/4);}(2)main(){ int a=2,b=3;float x=3.5,y=2.5;printf(%f\n,(float)(a+b)/2+(int)x%(int)y);}第三章顺序结构程序设计一选择题a c d c c二操作题1. x=3,a=2,b=32. z=12.7000002 13 3 2 bb cc abc n3. 1 2 1a2 1 2三.编程题编程题解:#include stdio.hmain(){float sj,gz,yfgz;printf(time,salary:);scanf(%f,%f,sj,gz);yfgz=sj*gz*0.9;printf(total salary:%f\n,yfgz);}本程序运行结果为:time,salary:4,3crtotal salary:10.8000002.编写一个程序求出任意一个输入字符的ascii码解:#include stdio.hmain(){char c;printf(input a string:);scanf(%c,c);printf(%c ascii is %d\n,c,c);}本程序运行结果为:input a string:acra ascii is 973、编写一个程序用于水果店售货员算帐:已知苹果每斤2.50元,鸭梨每斤1.80元,香蕉每斤2元,橘子每斤1.6元,要求输入各类水果的重量,打印出应付3解:main(){float p,y,x,j,ys,g,fk;printf(apple,pear,banana,orange(weight)=);scanf(%f,%f,%f,%f,p,y,x,j);ys=2.5*p+1.8*y+2*x+1.6*j;printf(fu kuan=);scanf(%f,g);fk=g-ys;printf(result:\n);printf(fukuan=%6.2fyuan\nshoukuan=%6.2fyuan\nzhaohui=%6. 2fyuan\n,g,ys,fk);}本程序运行结果为:apple,pear,banana,orange(weight)=1,2,3,4fu kuan=100result:fukuan=100.00yuanshoukuan= 18.50yuanzhaohui= 81.50yuan项目实训1.假设银行定期存款的年利率rate为2.25%,并已知存款期为n 年,存款本金为capital元,试编程计算n年后可得到本利之和deposit。
《计算机导论》(第2版)习题答案参考计算机导论(第2版)习题答案参考Chapter 1: Introduction to Computers1. Define a computer and discuss its attributes.A computer is an electronic device capable of performing various operations and processes based on a set of instructions. Its attributes include the ability to input, process, store, and output information, as well as the capability to execute complex calculations and perform tasks.2. Differentiate between hardware and software.Hardware refers to the physical components of a computer system, including the central processing unit (CPU), memory, storage devices, input/output devices, and peripherals. Software, on the other hand, represents the non-tangible parts of a computer system, such as programs and data that can be stored and executed by the hardware.3. Explain the concept of data representation and discuss different numbering systems used in computer systems.Data representation refers to the way data is stored and processed by a computer. Different numbering systems include the binary system (base-2), decimal system (base-10), octal system (base-8), and hexadecimal system (base-16). Each system has its own set of symbols and rules for representing numbers and characters.Chapter 2: Computer Hardware1. Discuss the major components of a computer system.A computer system consists of several major components, including the central processing unit (CPU), memory, storage devices, input/output devices, and peripherals. The CPU is responsible for executing instructions and performing calculations, while memory stores data and instructions temporarily. Storage devices are used for long-term data storage, andinput/output devices allow users to interact with the computer system.2. Describe the functions and characteristics of the CPU.The CPU is the central processing unit of a computer system and is responsible for executing instructions and performing calculations. It consists of two main components: the control unit, which manages the execution of instructions, and the arithmetic logic unit (ALU), which performs calculations and logical operations. The CPU's performance is determined by factors such as clock speed, cache size, and number of cores.3. Explain the different types of memory in a computer system.A computer system typically has two main types of memory: primary memory (RAM) and secondary memory (storage devices). RAM, or random access memory, is used for temporary data storage and is volatile, meaning its contents are lost when the power is turned off. Secondary memory, such as hard disk drives and solid-state drives, provides long-term storage for data even when the power is off.Chapter 3: Operating Systems1. Define an operating system and discuss its functions.An operating system is a software that manages computer hardware and software resources. Its functions include providing a user interface, managing memory and storage, coordinating the execution of applications, handling input/output operations, and ensuring system security and stability.2. Explain the difference between a single-user and multi-user operating system.A single-user operating system is designed to be used by one user at a time. It provides a user interface and manages the resources on the computer for the sole user. A multi-user operating system, on the other hand, allows multiple users to access the system simultaneously, sharing resources and executing their own programs concurrently.3. Discuss the concept of virtualization and its advantages.Virtualization is the process of creating a virtual version of a computer system or resources. It allows multiple operating systems to run on a single physical machine, enabling better resource utilization, cost savings, and improved flexibility. Virtualization also provides isolation between different virtual machines, enhancing security and system stability.In conclusion, this article provides a brief overview of the topics covered in the second edition of "Introduction to Computers." It includes explanations and answers to selected exercises, helping readers understand the fundamental concepts of computer science and technology. By studying these topics, readers can gain a strong foundation in computer knowledge and skills.。
Candidates may use any calculator allowed by the regulations of theJoint Council for Qualifications. Calculators must not have the facilityfor symbolic algebra manipulation, differentiation and integration, orhave retrievable mathematical formulae stored in them.Instructionst Use black ink or ball-point pen.t I f pencil is used for diagrams/sketches/graphs it must be dark (HB or B).Coloured pencils and highlighter pens must not be used.t Fill in the boxes at the top of this page with your name,centre number and candidate number.t A n swer all questions and ensure that your answers to parts of questions areclearly labelled.t A nswer the questions in the spaces provided– there may be more space than you need.t Y ou should show sufficient working to make your methods clear. Answerswithout working may not gain full credit.t V alues from the statistical tables should be quoted in full. When a calculator is used, the answer should be given to an appropriate degree of accuracy.Informationt The total mark for this paper is 75.t T he marks for each question are shown in brackets– use this as a guide as to how much time to spend on each question.Advicet Read each question carefully before you start to answer it.t Try to answer every question.tCheck your answers if you have time at the end.*P44847A0124*Turn over P44847A©2015 Pearson Education Ltd.5/1/1/2*P44847A0224*3Turn over*P44847A0324*4*P44847A0424*5Turn over*P44847A0524*6*P44847A0624*7Turn over*P44847A0724*8*P44847A0824*9Turn over*P44847A0924*10*P44847A01024*21Turn over*P44847A02124*22*P44847A02224*23 *P44847A02324*24*P44847A02424*。
Reading: Text 11.Match the words with their definitions.1g 2a 3e 4b 5c 6d 7j 8f 9h 10i2. Complete the following expressions or sentences by using the target words listed below with the help of the Chinese in brackets. Change the form if necessary.1 symbolic 2distributed 3site 4complex 5identify6fairly 7straightforward 8capability 9target 10attempt11process 12parameter 13interpretation 14technical15range 16exploit 17networking 18involve19 instance 20specification 21accompany 22predictable 23profile3. Read the sentences in the box. Pay attention to the parts in bold.Now complete the paragraph by translating the Chinese in brackets. You may refer to the expressions and the sentence patterns listed above.ranging from(从……到)arise from some misunderstandings(来自于对……误解)leaves a lot of problems unsolved(留下很多问题没有得到解决)opens a path for(打开了通道)requires a different frame of mind(需要有新的思想)4.Translate the following sentences from Text 1 into Chinese.1) 有些人声称黑客是那些超越知识疆界而不造成危害的好人(或即使造成危害,但并非故意而为),而“骇客”才是真正的坏人。
挑选的英语短语挑选,指从一些人或事物中选出合乎要求的。
下面就由店铺为大家带来关于挑选的英语短语集锦,希望大家能有所收获。
关于挑选的相关短语挑选 pick up挑选 single out挑选选手 choose players挑选角色 Casting by仔细挑选 choose carefully pick and choose挑选战场 CHOOSING THE BATTLEFIELD挑选货品 Choose item通道挑选 CHANNEL SELECT挑选工 culler;挑选归类 sorting;挑选家禽工 tipper; culler;挑选试验 percent test;挑选输送器 picking conveyer;挑选台 cull board关于挑选的相关例句1. He was hand-picked for this job by the Admiral.他是由海军上将精心挑选出来担任这项工作的。
2. Choose a soft, medium or firm mattress to suit their individual needs.针对他们各人不同的需要挑选柔软、软硬适中或者坚硬的床垫。
3. Here is an actress who could have her pick of any part.这是一个角色任她挑选的女演员。
4. These figures were often spuriously computed by selecting particularly favorable sample groups.这些数字往往是用错误的方法计算出来的,所用的都是特别挑选出来的对自己有利的样本组。
5. Here's another selection of recent letters from our postbag.这是我们从近期公众来信里挑选出的又一批信件。
6. The floorcovering you select will need to be impervious to water.挑选的地板材料必须是防水的。
2016年全国硕士研究生入学统一考试英语一试题Section I Use of EnglishDirections:Read the following text.Choose the best word(s)for each numbered blank and mark[A],[B],[C]or[D]on the ANSWER SHEET.(10points)In Cambodia,the choice of a spouse is a complex one for the young male.It may involve not only his parents and his friends,1those of the young woman,but also a matchmaker.A man can2a likely spouse on his own and then ask his parents to3the marriage negotiations,or the young man’s parents may make the choice of a spouse,giving the child little to say in the selection.4,a girl may veto the spouse her parents have chosen.5a spouse has been selected,each family investigates the other to make sure its child is marrying6a good family.The traditional wedding is a long and colorful affair.Formerly it lasted three days,7by the1980s it more commonly lasted a day and a half.Buddhist priests offer a short sermon and8prayers of blessing. Parts of the ceremony involve ritual hair cutting,9cotton threads soaked in holy water around the bride’s and groom’s wrists,and10a candle around a circle of happily married and respected couples to bless the 11.Newlyweds traditionally move in with the wife’s parents and may12with them up to a year, 13they can build a new house nearby.Divorce is legal and easy to14,but not common.Divorced persons are15with some disapproval. Each spouse retains16property he or she17into the marriage,and jointly-acquired property is 18equally.Divorced persons may remarry,but a gender discrimination19up:The divorced male doesn’t have a waiting period before he can remarry20the woman must wait ten months.1.[A]by way of[B]on behalf of[C]as well as[D]with regard to2.[A]adapt to[B]provide for[C]compete with[D]decide on3.[A]close[B]renew[C]arrange[D]postpone4.[A]Above all[B]In theory[C]In time[D]For example5.[A]Although[B]Lest[C]After[D]Unless6.[A]into[B]within[C]from[D]through7.[A]since[B]but[C]or[D]so8.[A]copy[B]test[C]recite[D]create9.[A]folding[B]piling[C]wrapping[D]tying10.[A]passing[B]lighting[C]hiding[D]serving11.[A]meeting[B]collection[C]association[D]union12.[A]grow[B]part[C]deal[D]live13.[A]whereas[B]until[C]if[D]for14.[A]obtain[B]follow[C]challenge[D]avoid15.[A]isolated[B]persuaded[C]viewed[D]exposed16.[A]whatever[B]however[C]whenever[D]wherever17.[A]changed[B]brought[C]shaped[D]pushed18.[A]withdrawn[B]invested[C]donated[D]divided19.[A]breaks[B]warns[C]shows[D]clears20.[A]so that[B]while[C]once[D]in thatSection II Reading ComprehensionPart ADirections:Read the following four texts.Answer the questions below each text by choosing[A],[B],[C]or[D].Mark your answers on the ANSWER SHEET.(40points)Text1France,which prides itself as the global innovator of fashion,has decided its fashion industry has lost an absolute right to define physical beauty for women.Its lawmakers gave preliminary approval last week to a law that would make it a crime to employ ultra-thin models on runways.The parliament also agreed to ban websites that“incite excessive thinness”by promoting extreme dieting.Such measures have a couple of uplifting motives.They suggest beauty should not be defined by looks that end up impinging on health.That's a start.And the ban on ultra-thin models seems to go beyond protecting models from starving themselves to death-as some have done.It tells the fashion industry that it must take responsibility for the signal it sends women,especially teenage girls,about the social tape-measure they must use to determine their individual worth.The bans,if fully enforced,would suggest to women(and many men)that they should not let others be arbiters of their beauty.And perhaps faintly,they hint that people should look to intangible qualities like character and intellect rather than dieting their way to size zero or wasp-waist physiques.The French measures,however,rely too much on severe punishment to change a culture that still regards beauty as skin-deep-and bone-showing.Under the law,using a fashion model that does not meet a government-defined index of body mass could result in a$85,000fine and six months in prison.The fashion industry knows it has an inherent problem in focusing on material adornment and idealized body types.In Denmark,the United States,and a few other countries,it is trying to set voluntary standards for models and fashion images that rely more on peer pressure for enforcement.In contrast to France’s actions,Denmark’s fashion industry agreed last month on rules and sanctions regarding the age,health,and other characteristics of models.The newly revised Danish Fashion Ethical Charter clearly states:“We are aware of and take responsibility for the impact the fashion industry has on body ideals, especially on young people.”The charter’s main tool of enforcement is to deny access for designers and modeling agencies to Copenhagen Fashion Week(CFW),which is run by the Danish Fashion Institute.But in general it relies on a name-and-shame method of compliance.Relying on ethical persuasion rather than law to address the misuse of body ideals may be the best step.Even better would be to help elevate notions of beauty beyond the material standards of a particular industry.21.According to the first paragraph,what would happen in France?[A]New runways would be constructed.[B]Physical beauty would be redefined.[C]Websites about dieting would thrive.[D]The fashion industry would decline.22.The phrase“impinging on”(Line2,Para.2)is closest in meaning to_____.[A]heightening the value of[B]indicating the state of[C]losing faith in[D]doing harm to23.Which of the following is true of the fashion industry?[A]New standards are being set in Denmark.[B]The French measures have already failed.[C]Models are no longer under peer pressure.[D]Its inherent problems are getting worse.24.A designer is most likely to be rejected by CFW for_____.[A]pursuing perfect physical conditions.[B]caring too much about models’character.2016年考研英语一真题及大师兄版解析29.The author holds that George Osborne’s preference_____.[A]reveals a strong prejudice against urban areas.[B]shows his disregard for the character of rural areas.[C]stresses the necessity of easing the housing crisis.[D]highlights his firm stand against lobby pressure.30.In the last paragraph,the author shows his appreciation of_____.[A]the size of population in Britain[B]the political life in today’s Britain[C]the enviable urban lifestyle in Britain[D]the town-and-country planning in BritainText3“There is one and only one social responsibility of business,”wrote Milton Friedman,a Nobel Prize-winning economist,“That is,to use its resources and engage in activities designed to increase its profits.”But even if you accept Friedman’s premise and regard corporate social responsibility(CSR)policies as a waste of shareholders’money,things may not be absolutely clear-cut.New research suggests that CSR may create monetary value for companies—at least when they are prosecuted for corruption.The largest firms in America and Britain together spend more than$15billion a year on CSR,according to an estimate by EPG,a consulting firm.This could add value to their businesses in three ways.First,consumers may take CSR spending as a“signal”that a company’s products are of high quality.Second,customers may be willing to buy a company’s products as an indirect way to donate to the good causes it helps.And third,through a more diffuse“halo effect,”whereby its good deeds earn it greater consideration from consumers and others.Previous studies on CSR have had trouble differentiating these effects because consumers can be affected by all three.A recent study attempts to separate them by looking at bribery prosecutions under America’s Foreign Corrupt Practices Act(FCPA).It argues that since prosecutors do not consume a company’s products as part of their investigations,they could be influenced only by the halo effect.The study found that,among prosecuted firms,those with the most comprehensive CSR programmes tended to get more lenient penalties.Their analysis ruled out the possibility that it was firms’political influence,rather than their CSR stand,that accounted for the leniency:Companies that contributed more to political campaigns did not receive lower fines.In all,the study concludes that whereas prosecutors should only evaluate a case based on its merits,they do seem to be influenced by a company’s record in CSR.“We estimate that either eliminating a substantial labour-rights concern,such as child labour,or increasing corporate giving by about20%results in fines that generally are40%lower than the typical punishment for bribing foreign officials,”says one researcher.Researchers admit that their study does not answer the question of how much businesses ought to spend on CSR.Nor does it reveal how much companies are banking on the halo effect,rather than the other possible benefits,when they decide their do-gooding policies.But at least they have demonstrated that when companies get into trouble with the law,evidence of good character can win them a less costly punishment.31.The author views Milton Friedman’s statement about CSR with_____.[A]tolerance[B]skepticism[C]uncertainty[D]approval32.According to Paragraph2,CSR helps a company by_____.[A]guarding it against malpractices[B]protecting it from consumers[C]winning trust from consumers[D]raising the quality of its products33.The expression“more lenient”(Line2,Para.4)is closest in meaning to_____.[A]more effective[B]less controversial[C]less severe[D]more lasting34.When prosecutors evaluate a case,a company’s CSR record_____.[A]legacy businesses are becoming outdated.[B]cautiousness facilitates problem-solving.[C]aggressiveness better meets challenges.[D]traditional luxuries can stay unaffected.40.Which of the following would be the best title of the text?_____.[A]Shift to Online Newspapers All at Once[B]Cherish the Newspapers Still in Your Hand[C]Make Your Print Newspapers a Luxury Good[D]Keep Your Newspapers Forever in FashionPart BDirections:Read the following text and answer the questions by choosing the most suitable subheading from the list A-G for each of the numbered paragraphs(41-45).There are two extra subheadings.Mark your answers on the ANSWER SHEET.(10point)[A]Create a new image of yourself[B]Have confidence in yourself[C]Decide if the time is right[D]Understand the context[E]Work with professionals[F]Make it efficient[G]Know your goalsNo matter how formal or informal the work environment,the way you present yourself has an impact.This is especially true in the first impressions.According to research from Princeton University,people assess your competence,trustworthiness,and likeability in just a tenth of a second,solely based on the way you look.The difference between today’s workplace and the“dress for success”era is that the range of options is so much broader.Norms have evolved and fragmented.In some settings,red sneakers or dress T-shirts can convey status;in others not so much.Plus,whatever image we present is magnified by social-media services like LinkedIn.Chances are,your headshots are seen much more often now than a decade or two lennials,it seems,face the paradox of being the least formal generation yet the most conscious of style and personal branding. It can be confusing.So how do we navigate this?How do we know when to invest in an upgrade?And what’s the best way to pull off one that enhances our goals?Here are some tips:41.__________________As an executive coach,I’ve seen image upgrades be particular helpful during transitions—when looking for a new job,stepping into a new or more public role,or changing work environments.If you’re in a period of change or just feeling stuck and in a rut,now may be a good time.If you’re not sure,ask for honest feedback from trusted friends,colleagues and professionals.Look for cues about how others perceive you.Maybe there’s no need for an upgrade and that’s OK.42.__________________Get clear on what impact you’re hoping to have.Are you looking to refresh your image or pivot it?For one person,the goal may be to be taken more seriously and enhance their professional image.For another,it may be to be perceived as more approachable,or more modern and stylish.For someone moving from finance to advertising, maybe they want to look more“SoHo.”(It’s OK to use characterizations like that.)43.__________________Look at your work environment like an anthropologist.What are the norms of your environment?What conveys status?Who are your most important audiences?How do the people you respect and look up to present themselves?The better you understand the cultural context,the more control you can have over your impact.44.__________________Enlist the support of professionals and share with them your goals and context.Hire a personal stylist,or use the free styling service of a store like J.Crew.Try a hair stylist instead of a barber.Work with a professional photographer instead of your spouse or friend.It’s not as expensive as you might think.45.__________________The point of a style upgrade isn’t to become more vain or to spend more time fussing over what to wear. Instead,use it as an opportunity to reduce decision fatigue.Pick a standard work uniform or a few go-to options. Buy all your clothes at once with a stylist instead of shopping alone,one article of clothing at a time.Section III TranslationDirections:Read the following text carefully and then translate the underlined segments into Chinese.Your translation should be written clearly on the ANSWER SHEET.(10points)Mental health is our birthright.(46)We don’t have to learn how to be mentally healthy;it is built into us in the same way that our bodies know how to heal a cut or mend,a broken bone.Mental health can’t be learned,only reawakened.It is like immune system of the body,which under stress or through lack of nutrition or exercise can be weakened,but which never leaves us.When we don’t understand the value of mental health and we don’t know how to gain access to it,mental health will remain hidden from us.(47)Our mental health doesn’t go anywhere; like the sun behind a cloud,it can be temporarily hidden from view,but it is fully capable of being restored in an instant.Mental health is the seed that contains self-esteem–confidence in ourselves and an ability to trust in our common sense.It allows us to have perspective on our lives—the ability to not take ourselves too seriously,to laugh at ourselves,to see the bigger picture,and to see that things will work out.It’s a form of innate or unlearned optimism.(48)Mental health allows us to view others with sympathy if they are having troubles,with kindness if they are in pain,and with unconditional love no matter who they are.Mental health is the source of creativity for solving problems,resolving conflict,making our surroundings more beautiful,managing our home life,or coming up with a creative business idea or invention to make our lives easier.It gives us patience for ourselves and toward others as well as patience while driving,catching a fish,working on our car,or raising a child.It allows us to see the beauty that surrounds us each moment in nature,in culture,in the flow of our daily lives.(49)Although mental health is the cure-all for living our lives,it is perfectly ordinary as you will see that it has been there to direct you through all your difficult decisions.It has been available even in the most mundane of life situations to show you right from wrong,good from bad,friend from foe.Mental health has commonly been called conscience,instinct,wisdom,common sense,or the inner voice.We think of it simply as a healthy and helpful flow of intelligent thought.(50)As you will come to see,knowing that mental health is always available and knowing to trust it allow us to slow down to the moment and live life happily.SectionⅣWritingPart A51.Directions:Suppose you are a librarian in your university.Write a notice of about100words providing the newly-enrolled international students with relevant information about the library.You should write neatly on the ANSWER SHEET.Do not sign your own name at the end of the e“Li Ming”instead.Do not write the address.(10points)Part B52.Directions:Write an essay of160-200words based on the following pictures.In your essay you should1)describe the drawing briefly,2)explain its intended meaning,and3)give your comments.You should write neatly on the ANSWER SHEET.(20points)2016年全国硕士研究生入学统一考试英语一试题大师兄版参考答案Section I Use of English(10points)1.A B C D2.A B C D3.A B C D4.A B C D5.A B C D6.A B C D7.A B C D8.A B C D9.A B C D10.A B C D11.A B C D12.A B C D13.A B C D14.A B C D15.A B C D16.A B C D17.A B C D18.A B C D19.A B C D20.A B C DSection II Reading Comprehension(50points)Part A(40points)21.A B C D22.A B C D23.A B C D24.A B C D25.A B C D26.A B C D27.A B C D28.A B C D29.A B C D30.A B C D31.A B C D32.A B C D33.A B C D34.A B C D35.A B C D36.A B C D37.A B C D38.A B C D39.A B C D40.A B C DPart B(10points)41.A B C D E F G42.A B C D E F G43.A B C D E F G44.A B C D E F G45.A B C D E F G注:第29题有争议,大师兄版选B,新东方版、沪江版选A。
Answers to Selected Exercises2. [was #2] (a) The program contains one directive (#include) and four statements (three calls of printf and one return).(b)Parkinson's Law:Work expands so as to fill the timeavailable for its completion.3. [was #4]#include <stdio.h>int main(void){int height = 8, length = 12, width = 10, volume;volume = height * length * width;printf("Dimensions: %dx%dx%d\n", length, width, height); printf("Volume (cubic inches): %d\n", volume);printf("Dimensional weight (pounds): %d\n", (volume + 165) / 166);return 0;}4. [was #6] Here's one possible program:#include <stdio.h> int main(void){int i, j, k; float x, y, z;printf("Value of i: %d\n", i); printf("Value of j: %d\n", j); printf("Value of k: %d\n", k); printf("Value of x: %g\n", x); printf("Value of y: %g\n", y);printf("Value of z: %g\n", z);return 0;}When compiled using GCC and then executed, this program produced the following output:Value of i: 5618848Value of k: 6844404Value of x: 3.98979e-34Value of y: 9.59105e-39Value of z: 9.59105e-39The values printed depend on many factors, so the chance that you'll get exactly these numbers is small.5. [was #10] (a) is not legal because 100_bottles begins with a digit.8. [was #12] There are 14 tokens: a, =, (, 3, *, q, -, p, *, p, ), /, 3, and ;. Answers to Selected Programming Projects4. [was #8; modified]#include <stdio.h>int main(void){float original_amount, amount_with_tax;printf("Enter an amount: ");scanf("%f", &original_amount); amount_with_tax = original_amount * 1.05f; printf("With tax added: $%.2f\n", amount_with_tax);return 0;}The amount_with_tax variable is unnecessary. If we remove it, the program is slightly shorter:#include <stdio.h>int main(void){float original_amount;printf("Enter an amount: ");scanf("%f", &original_amount);printf("With tax added: $%.2f\n", original_amount * 1.05f);return 0;}Answers to Selected Exercises2. [was #2](a) printf("%-8.1e", x);(b) printf("%10.6e", x);(c) printf("%-8.3f", x);(d) printf("%6.0f", x);5. [was #8] The values of x, i, and y will be 12.3, 45, and .6,respectively. Answers to Selected Programming Projects1. [was #4; modified]#include <stdio.h>int main(void){int month, day, year;printf("Enter a date (mm/dd/yyyy): "); scanf("%d/%d/%d", &month, &day, &year); printf("You entered the date %d%.2d%.2d\n", year, month, day);return 0;}3. [was #6; modified]#include <stdio.h> int main(void){int prefix, group, publisher, item, check_digit;printf("Enter ISBN: ");scanf("%d-%d-%d-%d-%d", &prefix, &group, &publisher, &item, &check_digit); printf("GS1 prefix: %d\n", prefix); printf("Group identifier: %d\n", group);printf("Publisher code: %d\n", publisher); printf("Item number: %d\n", item); printf("Check digit: %d\n", check_digit);/* The five printf calls can be combined as follows:printf("GS1 prefix: %d\nGroup identifier: %d\nPublisher code: %d\nItem number: %d\nCheck digit: %d\n", prefix, group, publisher, item, check_digit);*/return 0; }Answers to Selected Exercises2. [was #2] Not in C89. Suppose that i is 9 and j is 7. The value of (-i)/j could be either —1 or —2, depending on the implementation. On the other hand, the value of -(i/j) is always —1, regardless of the implementation.In C99, on the other hand, the value of (-i)/j must be equal to the value of -(i/j).9. [was #6](a) 63 8(b) 3 2 1(c) 2 -1 3(d) 0 0 013. [was #8] The expression ++i is equivalent to (i += 1). The value of both expressions is i after the increment has been performed.Answers to Selected Programming Projects2. [was #4]#include <stdio.h>int main(void){int n;printf("Enter a three-digit number: ");scanf("%d", &n);printf("The reversal is: %d%d%d\n", n % 10, (n / 10) % 10, n / 100);return 0;}Chapter 5Answers to Selected Exercises2. [was #2](a) 1(b) 1(c) 1(d) 14. [was #4] (i > j) - (i < j)6. [was #12] Yes, the statement is legal. When n is equal to 5, it does nothing, since 5 is not equal to - 9.10. [was #16] The output isonetwosince there are no break statements after the cases.Answers to Selected Programming Projects2. [was #6]#include <stdio.h> int main(void){int hours, minutes;printf("Enter a 24-hour time: "); scanf("%d:%d", &hours, &minutes);printf("Equivalent 12-hour time: ");if (hours == 0)printf("12:%.2d AM\n", minutes);else if (hours < 12)printf("%d:%.2d AM\n", hours, minutes);else if (hours == 12)printf("%d:%.2d PM\n", hours, minutes); elseprintf("%d:%.2d PM\n", hours - 12, minutes);return 0;}4. [was #8; modified]#include <stdio.h> int main(void){int speed;printf("Enter a wind speed in knots: "); scanf("%d", &speed);if (speed < 1)printf("Calm\n");else if (speed <= 3)printf("Light air\n");else if (speed <= 27) printf("Breeze\n");else if (speed <= 47) printf("Gale\n");else if (speed <= 63)printf("Storm\n");elseprintf("Hurricane\n");return 0;}6. [was #10]#include <stdio.h> int main(void){int check_digit, d, i1, i2, i3, i4, i5, j1, j2, j3, j4, j5, first_sum, second_sum, total;printf("Enter the first (single) digit: ");scanf("%1d", &d);printf("Enter first group of five digits: "); scanf("%1d%1d%1d%1d%1d", &i1, &i2,&i3, &i4, &i5); printf("Enter second group of five digits: ");scanf("%1d%1d%1d%1d%1d", &j1, &j2, &j3, &j4, &j5); printf("Enter the last (single) digit: ");scanf("%1d", &check_digit);first_sum = d + i2 + i4 + j1 + j3 + j5;second_sum = i1 + i3 + i5 + j2 + j4;total = 3 * first_sum + second_sum;if (check_digit == 9 - ((total - 1) % 10)) printf("VALID\n");elseprintf("NOT VALID\n");return 0;}10. [was #14]#include <stdio.h>int main(void){int grade;printf("Enter numerical grade: ");scanf("%d", &grade);if (grade < 0 || grade > 100) { printf("Illegal grade\n"); return 0;}switch (grade / 10) {case 10:case 9: printf("Letter grade: A\n"); break;case 8: printf("Letter grade: B\n"); break;case 7: printf("Letter grade: C\n"); break;case 6: printf("Letter grade: D\n"); break;case 5:case 4:case 3:case 2:case 1:case 0: printf("Letter grade: F\n"); break;}return 0;}Chapter 6Answers to Selected Exercises4. [was #10] (c) is not equivalent to (a) and (b), because i is incremented before the loop body is executed.10. [was #12] Consider the following while loop:while (…){continue;The equivalent code using goto would have the following appearance: while (…){goto loop_end;loop_end: ; /* null statement */}12. [was #14]for (d = 2; d * d <= n; d++) if (n % d == 0)}break;The if statement that follows the loop will need to be modified as well: if (d * d <= n)printf("%d is divisible by %d\n", n, d);elseprintf("%d is prime\n", n);14. [was #16] The problem is the semicolon at the end of the first line. If we remove it, the statement is now correct:if (n % 2 == 0) printf("n is even\n");Answers to Selected Programming Projects2. [was #2]#include <stdio.h>int main(void){int m, n, remainder;printf("Enter two integers: "); scanf("%d%d", &m, &n);while (n != 0) {remainder = m % n;m = n; n = remainder;printf("Greatest common divisor: %d\n", m);return 0;}4. [was #4]#include <stdio.h>int main(void){float commission, value;printf("Enter value of trade: ");scanf("%f", &value);while (value != 0.0f) {if (value < 2500.00f)commission = 30.00f + .017f * value;else if (value < 6250.00f) commission = 56.00f + .0066f * value;else if (value < 20000.00f)commission = 76.00f + .0034f * value;else if (value < 50000.00f) commission = 100.00f + .0022f * value;else if (value < 500000.00f)commission = 155.00f + .0011f * value;elsecommission = 255.00f + .0009f * value;if (commission < 39.00f)commission = 39.00f;printf("Commission: $%.2f\n\n", commission);printf("Enter value of trade: ");scanf("%f", &value);}return 0;}6. [was #6]#include <stdio.h> int main(void){int i, n;printf("Enter limit on maximum square: "); scanf("%d", &n);for (i = 2; i * i <= n; i += 2) printf("%d\n", i * i);return 0;}8. [was #8]#include <stdio.h> int main(void){int i, n, start_day;printf("Enter number of days in month: ");scanf("%d", &n);printf("Enter starting day of the week (1=Sun, 7=Sat): "); scanf("%d", &start_day);/* print any leading "blank dates" */for (i = 1; i < start_day; i++)printf(" ");/* now print the calendar */ for (i = 1; i <= n; i++) { printf("%3d", i);if ((start_day + i - 1) % 7 == 0) printf("\n");}return 0;}Chapter 7Answers to Selected Exercises3. [was #4] (b) is not legal.4. [was #6] (d) is illegal, since printf requires a string, not a character, as its first argument.10. [was #14] unsigned int, because the (int) cast applies only to j, not j * k.12. [was #16] The value of i is converted to float and added to f, then the result is converted to double and stored in d.14. [was #18] No. Converting f to int will fail if the value stored in f exceeds the largest value of type int.Answers to Selected Programming Projects 1. [was #2] short int values are usually stored in 16 bits, causing failure at 182. int and long int values are usually stored in 32 bits, with failure occurring at 46341.2. [was #8]#include <stdio.h> int main(void){int i, n;char ch;printf("This program prints a table of squares.\n"); printf("Enter number of entries in table: "); scanf("%d", &n);ch = getchar();/* dispose of new-line character following number of entries */ /* could simply be getchar(); */for (i = 1; i <= n; i++) { printf("%10d%10d\n", i, i * i);if (i % 24 == 0) {printf("Press Enter to continue...");ch = getchar(); /* or simply getchar(); */}}return 0;}5. [was #10]#include <ctype.h>#include <stdio.h>int main(void){int sum = 0;char ch;printf("Enter a word: ");while ((ch = getchar()) != '\n')switch (toupper(ch)) {case 'D': case 'G':sum += 2; break;case 'B': case 'C': case 'M': case 'P':sum += 3; break;case 'F': case 'H': case 'V': case 'W': case 'Y': sum += 4; break;case 'K':sum += 5; break;case 'J': case 'X': sum += 8; break;case 'Q': case 'Z': sum += 10; break;default: sum++; break;}printf("Scrabble value: %d\n", sum);return 0;}6. [was #12]#include <stdio.h> int main(void){printf("Size of int: %d\n", (int) sizeof(int)); printf("Size of short: %d\n", (int)sizeof(short));printf("Size of long: %d\n", (int) sizeof(long)); printf("Size of float: %d\n", (int)sizeof(float));printf("Size of double: %d\n", (int) sizeof(double));printf("Size of long double: %d\n", (int) sizeof(long double));return 0;}Since the type of a sizeof expression may vary from one implementation to another, it's necessary in C89 to cast sizeof expressions to a known type before printing them. The sizes of the basic types are small numbers, so it's safe to cast them to int. (In general, however, it's best to cast sizeof expressions to unsigned long and print them using %lu.) In C99, we can avoid the cast by using the %zu conversion specification.Chapter 8Answers to Selected Exercises1. [was #4] The problem with sizeof(a) / sizeof( t) is that it can't easily be checked for correctness by someone reading the program. (The reader would have to locate the declaration of a and makesure that its elements have type t .)2. [was #8] To use a digit d (in character form) as a subscript into thearray a, we would write a[d-'0']. This assumes that digits have consecutive codes in the underlying character set, which is true of ASCII and other popular character sets.7. [was #10]const int segments[10][7] = {{1, 1, 1, 1, 1, 1},{0, 1, 1},{1, 1, 0, 1, 1, 0, 1},{1, 1, 1, 1, 0, 0, 1},{0, 1, 1, 0, 0, 1, 1},{1, 0, 1, 1, 0, 1, 1},{1, 0, 1, 1, 1, 1, 1},{1, 1, 1},{1, 1, 1, 1, 1, 1, 1},{1, 1, 1, 1, 0, 1, 1}};Answers to Selected Programming Projects2. [was #2]#include <stdio.h> int main(void){int digit_count[10] = {0};int digit;long n;printf("Enter a number: "); scanf("%ld", &n);while (n > 0) { digit = n % 10; digit_count[digit]++; n /= 10;}printf ("Digit: ");for (digit = 0; digit <= 9; digit++) printf("%3d", digit);printf("\nOccurrences:");for (digit = 0; digit <= 9; digit++) printf("%3d", digit_count[digit]);printf("\n");return 0;}5. [was #6]#include <stdio.h> #define NUM_RATES ((int) (sizeof(value) / sizeof(value[0]))) #define INITIAL_BALANCE 100.00 int main(void){int i, low_rate, month, num_years, year; double value[5];printf("Enter interest rate: "); scanf("%d", &low_rate); printf("Enter number of years: "); scanf("%d", &num_years);printf("\nYears");for (i = 0; i < NUM_RATES; i++) { printf("%6d%%", low_rate + i); value[i] =INITIAL_BALANCE;} printf("\n");for (year = 1; year <= num_years; year++) { printf("%3d ", year);for (i = 0; i < NUM_RATES; i++) {for (month = 1; month <= 12; month++)value[i] += ((double) (low_rate + i) / 12) / 100.0 * value[i]; printf("%7.2f",value[i]);} printf("\n");}return 0;}8. [was #12]#include <stdio.h>#define NUM_QUIZZES 5#define NUM_STUDENTS 5int main(void){int grades[NUM_STUDENTS][NUM_QUIZZES];int high, low, quiz, student, total;for (student = 0; student < NUM_STUDENTS; student++) { printf("Enter grades for student %d: ", student + 1);for (quiz = 0; quiz < NUM_QUIZZES; quiz++) scanf("%d", &grades[student][quiz]);}printf("\nStudent Total Average\n");for (student = 0; student < NUM_STUDENTS; student++) { printf("%4d ", student +1);total = 0;for (quiz = 0; quiz < NUM_QUIZZES; quiz++)total += grades[student][quiz];printf("%3d %3d\n", total, total / NUM_QUIZZES);}printf("\nQuiz Average High Low\n");for (quiz = 0; quiz < NUM_QUIZZES; quiz++) {printf("%3d ", quiz + 1);total = 0;high = 0;low = 100;for (student = 0; student < NUM_STUDENTS; student++) { total +=grades[student][quiz];if (grades[student][quiz] > high)high = grades[student][quiz];if (grades[student][quiz] < low)low = grades[student][quiz];}printf("%3d %3d %3d\n", total / NUM_STUDENTS, high, low); }return 0;}Chapter 9Answers to Selected Exercises2. [was #2]int check(int x, int y, int n){return (x >= 0 && x <= n - 1 && y >= 0 && y <= n - 1); }4. [was #4] int day_of_year(int month, int day, int year) {int num_days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};int day_count = 0, i;for (i = 1; i < month; i++)day_count += num_days[i-1];/* adjust for leap years, assuming they are divisible by 4 */if (year % 4 == 0 && month > 2)day_count++;return day_count + day;}Using the expression year %4 == 0 to test for leap years is not completely correct. Centuries are special cases: if a year is a multiple of 100, then it must also be a multiple of 400 in order to be a leap year. The correct test is year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)6. [was #6; modified]int digit(int n, int k){int i;for (i = 1; i < k; i++)n /= 10;return n % 10;}8. [was #8] (a) and (b) are valid prototypes. (c) is illegal, since it doesn't specify the type of the parameter. (d) incorrectly specifies that f returns an int value in C89; in C99, omitting the return type is illegal.10. [was #10](a)int largest(int a[], int n){int i, max = a[0];for (i = 1; i < n; i++)if (a[i] > max) max = a[i];return max;}(b)int average(int a[], int n){int i, avg = 0;for (i = 0; i < n; i++)avg += a[i];return avg / n;}(c)int num_positive(int a[], int n){int i, count = 0;for (i = 0; i < n; i++) if (a[i] > 0) count++;return count;}15. [was #12; modified]double median(double x, double y, double z) {double result;if (x <= y)if (y <= z) result = y; else if (x <= z) result = z; else result = x; else {if (z <= y) result = y; else if (x <= z) result = x; else result = z;return result;}17. [was #14]int fact(int n){int i, result = 1;for (i = 2; i <= n; i++)result *= i;return result;}19. [was #16] The following program tests the pb function: #include <stdio.h> void pb(int n);int main(void){int n;printf("Enter a number: "); scanf("%d", &n);printf("Output of pb: "); pb(n);printf("\n");return 0;}void pb(int n){if (n != 0) {pb(n / 2); putchar('0' + n % 2);}}pb prints the binary representation of the argument n, assuming that nis greater than 0. (We also assume that digits have consecutive codes in the underlying character set.) For example:Enter a number: 53 Output of pb: 110101A trace of pb's execution would look like this:pb(53) finds that 53 is not equal to 0, so it calls pb(26), which finds that 26 is not equal to 0, so it calls pb(13), which finds that 13 is not equal to 0, so it callspb(6), which finds that 6 is not equal to 0, so it calls pb(3), which finds that 3 is not equal to 0, so it callspb(1), which finds that 1 is not equal to 0, so it callspb(0), which finds that 0 is equal to 0, soit returns, causingpb(1) to print 1 and return, causing pb(3) to print 1 and return, causing pb(6) to print 0 and return, causing pb(13) to print 1 andreturn, causing pb(26) to print 0 and return, causingpb(53) to print 1 and return.Chapter 10Answers to Selected Exercises1. [was #2] (a) a, b, and c are visible.(b) a, and d are visible.(c) a, d, and e are visible.(d) a and f are visible.Answers to Selected Programming Projects3. [was #4]#include <stdbool.h> /* C99 only */#include <stdio.h>#include <stdlib.h>#define NUM_CARDS 5#define RANK 0#define SUIT 1 /* external variables */ int hand[NUM_CARDS][2];/* 0 10 | ___ | ___1 | ___ | ___2 | ___ | ___3 | ___ | ___4 | ___ | ___rank suit*/ bool straight, flush, four, three; int pairs; /* can be 0, 1, or 2 */ /* prototypes */void read_cards(void);void analyze_hand(void);void print_result(void); /*********************************************************** main: Calls read_cards, analyze_hand, and print_result * repeatedly. ***********************************************************/ int main(void){for (;;) {read_cards();analyze_hand();print_result();}}/*********************************************************** read_cards: Reads the cards into the external variable* hand; checks for bad cards and duplicate ** cards. * **********************************************************/ void read_cards(void) {char ch, rank_ch, suit_ch; int i, rank, suit;bool bad_card, duplicate_card; int cards_read = 0;while (cards_read < NUM_CARDS) { bad_card = false;printf("Enter a card: ");rank_ch = getchar();switch (rank_ch) {case '0': exit(EXIT_SUCCESS);case '2': rank = 0; break;case '3': rank = 1; break;case '4': rank = 2; break;case '5': rank = 3; break;case '6': rank = 4; break;case '7': rank = 5; break;case '8': rank = 6; break;case '9': rank = 7; break;case 't': case 'T': rank = 8; break; case 'j': case 'J': rank = 9; break; case 'q':case 'Q': rank = 10; break; case 'k': case 'K': rank = 11; break; case 'a': case 'A': rank = 12; break; default: bad_card = true;}suit_ch = getchar();switch (suit_ch) {case 'c': case 'C': suit = 0; break; case 'd': case 'D': suit = 1; break; case 'h':case 'H': suit = 2; break; case 's': case 'S': suit = 3; break; default: bad_card = true;}while ((ch = getchar()) != '\n') if(ch != ' ') bad_card = true;if (bad_card) {printf("Bad card; ignored.\n");continue;}duplicate_card = false;for (i = 0; i < cards_read; i++)if (hand[i][RANK] == rank && hand[i][SUIT] == suit) { printf("Duplicate card;ignored.\n"); duplicate_card = true;break;}if (!duplicate_card) {hand[cards_read][RANK] = rank; hand[cards_read][SUIT] = suit;cards_read++;}}}/*********************************************************** analyze_hand: Determines whether the hand contains a* straight, a flush, four-of-a-kind, ** and/or three-of-a-kind; determines the ** number of pairs; stores the results into ** the external variables straight, flush, ** four, three, and pairs. ***********************************************************/ void analyze_hand(void){int rank, suit, card, pass, run;straight = true; flush = true; four = false; three = false; pairs = 0;/* sort cards by rank */for (pass = 1; pass < NUM_CARDS; pass++)for (card = 0; card < NUM_CARDS - pass; card++) { rank = hand[card][RANK];suit = hand[card][SUIT];if (hand[card+1][RANK] < rank) { hand[card][RANK] = hand[card+1][RANK];hand[card][SUIT] = hand[card+1][SUIT]; hand[card+1][RANK] = rank;hand[card+1][SUIT] = suit;}}/* check for flush */suit = hand[0][SUIT];for (card = 1; card < NUM_CARDS; card++) if (hand[card][SUIT] != suit) flush = false;/* check for straight */for (card = 0; card < NUM_CARDS - 1; card++)if (hand[card][RANK] + 1 != hand[card+1][RANK]) straight = false;/* check for 4-of-a-kind, 3-of-a-kind, and pairs by looking for "runs" of cards with identical ranks */ card = 0;while (card < NUM_CARDS) {rank = hand[card][RANK];run = 0;do {run++; card++;} while (card < NUM_CARDS && hand[card][RANK] == rank); switch (run) { case 2: pairs++; break;case 3: three = true; break;case 4: four = true; break;}}}/*********************************************************** print_result: Prints the classification of the hand, ** based on the values of the external ** variables straight, flush, four, three, ** and pairs. ***********************************************************/ void print_result(void){if (straight && flush) printf("Straight flush");else if (four) printf("Four of a kind");else if (three &&pairs == 1) printf("Full house");printf("Flush"); printf("Straight"); printf("Three of a kind"); else if (pairs == 2) printf("Two pairs"); else if (pairs == 1)printf("Pair"); else printf("High card"); printf("\n\n");}5. [was #6]#include <stdbool.h> /* C99 only */#include <stdio.h>#include <stdlib.h> #define NUM_RANKS 13#define NUM_SUITS 4#define NUM_CARDS 5/* external variables */int num_in_rank[NUM_RANKS]; int num_in_suit[NUM_SUITS]; bool straight, flush, four, three; int pairs; /* can be 0, 1, or 2 */ /* prototypes */void read_cards(void); void analyze_hand(void);void print_result(void);/*********************************************************** main: Calls read_cards, analyze_hand, and print_result* repeatedly. * **********************************************************/ int main(void) {for (;;) {read_cards(); analyze_hand();print_result();}}/*********************************************************** read_cards: Reads the cards into the external* variables num_in_rank and num_in_suit;* checks for bad cards and duplicate cards.********************************************************** void read_cards(void) {bool card_exists[NUM_RANKS][NUM_SUITS]; char ch, rank_ch, suit_ch; int rank, suit;bool bad_card;int cards_read = 0;for (rank = 0; rank < NUM_RANKS; rank++) { num_in_rank[rank] = 0;for (suit = 0; suit < NUM_SUITS; suit++) card_exists[rank][suit] = false;}else if (flush)else if (straight) else if (three)for (suit = 0; suit < NUM_SUITS; suit++) num_in_suit[suit] = 0;while (cards_read < NUM_CARDS) { bad_card = false;printf("Enter a card: ");rank_ch = getchar();switch (rank_ch) {case '0': exit(EXIT_SUCCESS);case '2': rank = 0; break;case '3': rank = 1; break;case '4': rank = 2; break;case '5': rank = 3; break;case '6': rank = 4; break;case '7': rank = 5; break;case '8': rank = 6; break;case '9': rank = 7; break;case 't': case 'T': rank = 8; break; case 'j': case 'J': rank = 9; break; case 'q': case 'Q': rank = 10; break;case 'k': case 'K': rank = 11; break;case 'a': case 'A': rank = 12; break; default: bad_card = true;}suit_ch = getchar(); switch (suit_ch) {case 'c': case 'C': suit = 0; break;case 'd': case 'D': suit = 1; break;case 'h': case 'H': suit = 2; break;case 's': case 'S': suit = 3; break; default: bad_card = true;}while ((ch = getchar()) != '\n') if(ch != ' ') bad_card = true;if (bad_card) printf("Bad card; ignored.\n");else if (card_exists[rank][suit]) printf("Duplicate card; ignored.\n");else { num_in_rank[rank]++; num_in_suit[suit]++; card_exists[rank][suit] = true;cards_read++;}}} /*********************************************************** analyze_hand: Determines whether the hand contains a* straight, a flush, four-of-a-kind, *。
新大学通用英语教材2答案Introduction:The New College General English Textbook 2 is a comprehensive guide that aims to enhance students' proficiency in the English language. This article provides the answers to various exercises found in the textbook, offering students a valuable resource to check their progress and deepen their understanding of the material.Unit 1: Grammar1. Fill in the blanks with the appropriate verb tense:a) I have been studying English for two years.b) She will meet you at the library tomorrow.c) He had already left when I arrived.d) We will be going on a vacation next month.2. Choose the correct form of the verb to complete the sentence:a) My brother drives (drives/drive) to work every day.b) The students are studying (is studying/are studying) for their exams.c) She has finished (has finished/have finished) her assignment already.Unit 2: Reading ComprehensionRead the following passage and answer the questions:Passage:Technology has revolutionized the way we communicate, making the world a smaller place. With the rise of social media platforms and instant messaging apps, people can connect with each other across the globe, regardless of distance or time zones.1. What has technology revolutionized?Technology has revolutionized the way we communicate.2. How has technology made the world a smaller place?Technology has made the world a smaller place by allowing people to connect with each other across the globe.Unit 3: Listening SkillsListen to the audio and answer the questions:Audio:[Transcript: The weather forecast for tomorrow predicts sunny skies with a high of 25 degrees Celsius.]1. What does the weather forecast predict for tomorrow?The weather forecast predicts sunny skies with a high of 25 degrees Celsius.Unit 4: Vocabulary and Word UsageChoose the correct word or phrase to complete the sentence:1. She is an excellent pianist. Her skills are(amazing/incredible/remarkable).2. I need to (buy/purchase/acquire) a new laptop for school.3. The book was so (captivating/fascinating/engrossing) that I couldn't put it down.Unit 5: Writing SkillsWrite a paragraph about your favorite holiday destination:My favorite holiday destination is Bali. It is a tropical paradise with stunning beaches and vibrant cultural experiences. The crystal-clear waters and white sandy beaches provide the perfect backdrop for relaxation and sunbathing. Additionally, Bali offers a variety of cultural attractions, such as temples and traditional dance performances. The warm and welcoming locals add to the charm of this beautiful island. Overall, Bali is a must-visit destination for anyone seeking a blend of natural beauty and cultural richness.Conclusion:This article has provided the answers to selected exercises from the New College General English Textbook 2. By reviewing these answers, students can assess their understanding of the material and deepen their knowledge of English grammar, reading comprehension, listening skills, vocabulary, and writing skills. The textbook serves as a valuable resource for students seeking to improve their proficiency in the English language.。
大学数学的英语教材College Mathematics English TextbookIntroduction引言In recent years, the importance of studying mathematics at the college level has become increasingly recognized. As a core subject, mathematics plays a crucial role in developing problem-solving skills and logical thinking abilities. However, for English-speaking students, finding suitable English textbooks for college mathematics courses can be a challenge. In this article, we will explore the characteristics and requirements of a comprehensive English textbook for college mathematics.Content Organization内容组织A well-structured college mathematics English textbook should cover a broad range of topics, including but not limited to calculus, algebra, geometry, and probability. Each topic should be organized into chapters, providing a logical progression from fundamental concepts to advanced applications. Furthermore, the textbook should include clear explanations, relevant examples, and practice problems to enhance students' understanding and mastery of each topic.Language Level语言水平To cater to English-speaking students, the language level used in the textbook should be appropriate for college-level learners. The content should be presented in a clear, concise, and accessible manner, free from excessive jargon or technical terms. Additionally, the textbook should provide a glossary with key mathematical terminologies and symbols, aiding students in comprehension and retention.Real-World Applications现实世界应用To foster students' appreciation and engagement with mathematics, the textbook should include real-world applications of mathematical concepts. By connecting abstract theories to practical scenarios, students can understand the relevance and versatility of mathematics in various fields such as finance, engineering, and data analysis. Case studies and examples that demonstrate the practicality of mathematical problem-solving should be incorporated throughout the textbook.Interactive Learning Resources互动学习资源To enhance the learning experience, the textbook should provide supplemental learning resources. These can include online platforms, interactive quizzes, and multimedia materials such as videos or animations. These resources should promote active learning, enabling students to apply theoretical knowledge to solve problems, check their progress, and reinforce their understanding.Exercises and Assessments练习和评估To gauge students' comprehension and progress, the textbook should feature a variety of exercises and assessments. These should range from simple, knowledge-based questions to complex, application-based problems. The textbook should also provide step-by-step solutions or answers to selected exercises, allowing students to self-assess and identify areas that require further attention.Inclusive and Diverse Examples包容多样性的例子To create an inclusive learning environment, the textbook should incorporate examples that resonate with students from various cultural backgrounds. Including diverse examples not only allows for cultural appreciation but also highlights the universality of mathematical concepts. By showcasing how mathematics is applied and valued across different cultures, students can develop a deeper understanding and global perspective.Conclusion结论In conclusion, a comprehensive English textbook for college mathematics should provide a well-organized structure, suitable language level, real-world applications, interactive learning resources, varied exercises, and inclusive examples. Such a textbook will not only facilitate English-speaking students' understanding and mastery of mathematical concepts but also foster their appreciation for the subject. As the demand forEnglish textbooks in college mathematics continues to grow, educators and publishers must collaborate to develop high-quality resources that bridge the gap between mathematics and language learning.。