exercise3

合集下载

英国文学Exercise 3

英国文学Exercise 3

Exercise 3I.Fill in the following blanks.1.I n 1642, the civil war broke out in England. The royalists were defeated by the parliament army led by _____. In 1649, _____ was beheaded and England was declared to be a commonwealth.2.T he Revolution Period is also called _____, because the English Revolution was carried out under a religious cloak.3.T he _____Revolution in 1688 was so called because it was bloodless and there was no revival of the revolutionary demands.4.I n Revolution Period _John Milton____ towers over his age as William Shakespeare towers over the Elizabethan Age and as Chaucer towers over the Medieval period.5.I n Milton’s works, “_Paradise Lost_____”is the greatest, indeed the only generally acknowledged epic in English literature since “Beowulf”.6.T he finest thing in “Paradise Lost” is thedescription of hell, and _Satan ____ is the real hero of the poem.7.J ohn Bunyan’s masterpiece “_The Pilgrim’s Progress____”is a religious allegory, a narrative in which general concepts such as sins, despair, and faith are represented as people or as aspects of the natural world.8.A bout the beginning of the 17th century appeared a school of poets called _____, among whom John Donne was the leading one.9._John Dryden ___ wrote many works on literary criticism, and has been regarded as the earliest literary critic of real important in the history of English literature.10.The main literary achievements of the 17th century lies in the poetry of _____, in the prose writing of _____, and in the plays and literary criticism of _____.II.Choose one or more answers for thefollowing.1.T he revolution of 1688 meant three of the following things EXCEPT _____.A. the supremacy of ParliamentB. the beginning of modern EnglandC. the establishment of a constitutional monarchy in the countryD. the Restoration of monarchy2.J ohn Milton was _____.A. one of the giants of English literature in the 17th centuryB. blind in his later lifeC. a distinguished Revolutionary writerD. the greatest poet and pamphleteer in his age3.“Paradise Lost” is _____.A. a great epic of 12 booksB. based on Bible storyC. written in blank verseD. about the heroic revolt of Satan against God’s authority4.W hich work was not written by John Milton?A. Paradise LostB. Paradise RegainedC. Samson AgonistesD. V olphone5.A mong the poets of the seventeenth century, Milton was the greatest. Besides him, there were two groups of poets. They were _____.A. the lake poetsB. the university witsC. the Metaphysical poetsD. the Cavalier poets.III.Decide whether the following statements are true or false1.E nglish literature of the 17th century witnesses a flourish on the whole.2.T he Revolution period produced one of the most important poets in English literature, William Shakespeare.3.T he main literary form in literature of Revolution Period is drama.4.“The Pilgrim’s Progress” is one of the mostpopular pieces of Christian writing produced during the 17th century.5.J ohn Dryden is the most excellent representative of English classicism in the Restoration period.IV.Answer the following questions1.W hat are the different aspects between the literature of Elizabethan period and the literature of the Revolution period?2.W hat is the story of “Paradise Lost”?3.M ake a comment on the image of Satan in “Paradise Lost”.4.D iscuss the theme and characterization of “Paradise Lost”.5.W hat are the features of Milton’s poetry?。

专业英语Exercise3

专业英语Exercise3

Translate the following sentences:1.He was not to be moved by either advice or entreaties.2.When he entered the room there was a hush of expectancy.3.But reality makes things difficult.现实,实际,真实4.Since he lost his job, he’s been a loner.孤独的人, 不合群的动物Be careful! He is known as a blame-shifter.移动装置(移相器,变速拨叉,印字换行器,搬移者n. 过失, 责备vt. 责备, 归咎于5.He was a regular合格的; 正式的; 公认的; 合乎礼仪的[口]完全的, 真正的, 十足的6.contributo贡献者,捐助者,赠送者r to that magazine.7.He is suggestively silent.提示性的,影射的,暗示的8.She was pardonably proud of her wonderful cooking.w enforcement cannot responsibly stand aloof.10.The apparent cause of his illness was excessive drinking.11.She wanted to find a lonely place to shed private tears.12.We went our separate ways home from the theatre.13.I am no match for him in skill who has operated the lathe for tenyears.14.As she turned the corner she had a new idea which made her stopdead.15.My publishers, with whom I have excellent relations, alwaysgive my new books wide publicity.16.艰巨的任务蓬勃的发展果断的措施进一步努力17.It’s been interesting to talk with you.18.I dare say he is honesty.19.Tell me it was a misunderstanding.20.Don’t let him tell you that.21.Finally I told him where to get off.22.Success at language is more a matter of application than ofintelligence.23.There is more to peace, not just the absence of war or armedconflict.24.He was more shy than unsociable.25.A young men’s first car is less a means of transportation thanmonument to his youthful abandon.26.He has more than repaid her kindness.27.A panda is no more a cat than a dog.28.我们主张民主。

六年级上册英语一课一练Module2Unit6Exercise3∣牛津上海版

六年级上册英语一课一练Module2Unit6Exercise3∣牛津上海版

牛津上海版(一起)2019-2019学年小学英语六年级上册Module 2 Places and activities Unit 6 Goingto school Exercise 3一、将下列词组翻译成英语1.将下列词组翻译成英语(1)乘地铁________(2)乘轻轨________(3)去百货商店________(4)广告牌________2.将下列词组翻译成英语(1)在……路上________(2)警察局________(3)地铁站________(4)邮电局________二、选择合适的单词填空3.It usually takes me about two hours ________ (to go/go) to school by bus.4.Peter ________ (sits/seats) on the bus for ten minutes every day.5.Do you live ________ (near/close) the cinema?6.What's the name ________ (in/of) the street?7.The bus goes very ________ (slow/slowly) because of heavy traffic.8.The children under 5 years old usually go to ________ (a primary school/a kindergarten).9.He left home half ________ (a/an) hour ago. He could catch the bus.三、选择最恰当的答案10.My uncle's daughter is my ________.A. sisterB. auntC. cousinD. brother11.He is ________ Ben some questions ________ public signs.A. asks;toB. asks;asC. asking;about D. asking;to12.—What does that sign mean?—________.A. It means you must keep from the grassB. It means you must keep off the grassC. They mean you shouldn't keep off the grassD. They mean you should keep from the grass13.—Would you like ________ my home?—Yes, ________.A. to come to, I'd like toB. coming, I'd like toC. to come, Ido D. coming, I do14.—What ________ you like ________ a New Year's present?—________ a yo-yo·A. do, as, I'd likeB. would, as, I'd likeC. do, for, I'd like toD. would, as, I'd like to四、根据所给音标,完成句子15.We can see many ________/əd'vɜːtɪsmənt/on both sides of the streets.16.People have to walk when they are in the big ________/'træfɪk/jam.17.—Do you like ________/'trevəlɪŋ/?—Yes, It can make me know more about our country.18.—Where do you play football after school?—I play football on the________/'pleɪgraʊnd/.19.Dick usually goes to work late, today he goes to work ________/'ɜːlɪ/.五、根据要求改写句子20.I like taking the underground to work. (改为一般疑问句)21.We sat on the bus for half an hour. (对划线部分提问)22.Mr Bush goes to work by bicycle. (对划线部分提问)23.My grandparents often go to sleep at 8 p. m..(对划线部分提问)24.There aren't any shops in that street. (改为肯定句)六、阅读理解25.阅读短文,判断下列句子是否与短文内容一致。

五年级上册英语一课一练-Module3Unit2Exercise3∣牛津上海版(一起)(含解析)

五年级上册英语一课一练-Module3Unit2Exercise3∣牛津上海版(一起)(含解析)

牛津上海版(试用本)2018-2019学年小学英语五年级上册Module 3 Places and activities Unit 2 Buying new clothes Exercise 3一、抄写句子1.正确抄写下列句子,注意大小写和标点符号which shorts do you like the blue ones or the green ones二、根据音标词,写出正确的单词2.I like the T-shirt with ________/'bʌtəns/.3.Kitty and her ________/'mʌðʒ/ are at a clothes shop.4.The trousers are too ________/ʃɔːt/for me.5.I put some money in my ________/'pɒkɪt/.三、按要求改写下列句子6.I want a pair of trousers for my birthday. (根据划线提问)7.Kitty usually goes to the cinema at three in the afternoon. (根据划线提问)8.Jill and Kitty like walking in the school garden. (根据划线提问)9.My parents like black and white buttons. (根据划线提问)10.The long zips are twenty yuan. (改为一般疑问句)11.This pocket is small. That pocket is small, too. (合并成一句,但意思不变)12.Kitty and her mother often buy some books. (把often改成now)13.The emperor's coat is new. (改成否定句,但意思不变)四、根据首字母,补全单词14.阅读对话,完成短文,首字母已给。

大学英语(三)Unit 1 Passage A Exercise 答案

大学英语(三)Unit 1  Passage A  Exercise  答案
(Para. 12)
Answer: Frogs were being found whose skin was like paper.
(Para. 12)
Answecies”.
Then, I understood.(Para. 13)
(Para. 14)
Answer: The frogs have a message for us.
(Para. 14)
Answer: We must be the adults for the planet.
We (humans and fogs)are related.(Para. 15)
Answer: open
You tell the frog what you will do.
Answer: open
2. Find out more supporting details in the passage for the following statements, especially the underlined parts.
(Para. 6)
Answer: He stopped and turned around and just sat there looking at me.
I felt I understood why he was there.(Para. 8)
Frogs simply want to hear other frogs and to communicate. (Para. 8)
I found a tree frog in my studio some months ago. I took it to my g (您未填写此题) , as I thought it would be a better place for the frog.But it came back and insisted taking the r (您未填写此题) in the studio. Why? I couldn’t get an idea. Then, after five months of being together, we seemed to be able to c (您未填写此题) with each other. It may sound w (您未填写此题) , but I did feel I came to understand what it wanted me to do. The frog came to me probably attracted by the h (您未填写此题) tone of my computer, which sounded like that of other tree frogs, or with a m (您未填写此题) to tell me that frogs were dying around the world because of their s (您未填写此题) to the pollution and global climate change. As frogs are an“ i (您未填写此题) species”, what has happened to them may happen to us, if we sit back and do nothing. We must act now, or it would be too late.

研究生英语exercise 3

研究生英语exercise 3

Exercise---3用顺译、逆译、分译或综合法将下列各长句译为汉语:1. On August 1, the gunboat began her mission, //which was, //in the eyes of the defenders,// a provocative act and seemed to be part of the overall assault //which had begun on July 31.2. Does it really help society, or the victim, or the victim's family, //to put in jail a man,//who drove a car while drunk, has injured or killed another person?3. When we bought the house// there were small trees growing from the roof, all the windows had gone, and it had not been lived in for many years --- //Indeed it has all but fallen into ruin several times in its long life.4. All they have to do is// to press a button,// and they can see plays, films, operas, and shows of every kind, //not to mention political discussions and the latest exciting football match.5. Fourscore and seven years ago,//our fathers brought forth upon this continent //a new nation, //conceived in liberty and //dedicated to the proposition //that all men are created equal.6. You must fix in mind //the symbols and formulae, definitions and laws of physics,// no matter how complex they may be, //when you come in contact with them, //in order that you may understand the subject better and lay a solid foundation for further study.7. People //were afraid// to leave their houses,// for although the police had been ordered// to stand by// in case of emergency,//they were just as confused and helpless //as anybody else.定语从句的翻译:1. Furthermore, humans have the ability //to modify the environment //in which they live, thus subjecting// all other life forms// to their own peculiar ideas and fancies.2. After the riot, fifty people were taken to the hospital,// many of whom had been innocent bystanders.3. It is he who received the letter// that announced the death of your uncle.4. He had talked to Vice-President Nixon, //who assured him that everything// that couldbe done would be done.5. There is a man downstairs// who wants to see you.6. We used a plane//of which almost every part //carried //some indication of national identity.7. But he did not talk// at length //about the matter,// which was not considered by the White House// to be a particularly important question.8. She opposed the idea, //as might be expected.9. He wishes to write an article //that will attract public attention to the matter.10. He insisted on //buying another coat, //which he had no use for.被动语态的翻译:1. If the scheme is approved, work on the project will start immediately.2. The old man was knocked down by a speeding truck.3. The three machines can be controlled by a single operator.4. The little boy was criticized three times last week.5. Only those parts of the moon //which are lighted up by the sun// are bright.6. Private enterprise and industry were permitted and encouraged.7. It must be dealt with// at the appropriate time //with appropriate means.8. The result of the invention of the steam engine// was// that human power was replacedby mechanical power.9. Rainbows are formed// when sunlight passes through small drops of water //in the sky.10. Communications satellites are used for international living transmission // throughoutthe world.。

Exercise 3

Impressions of America(Excerpts)Oscar WildeI fear I cannot picture America as altogether an Elysium- perhaps, from the ordinary standpoint and I know little about the country. I cannot give its latitude or longitude; I cannot compute the value of its dry goods, and I have no very close acquaintance with its politics. These are matters which may not interest you, and they certainly are not interesting to me.The first thing that struck me on landing in America was that if the Americans are not the most well-dressed people in the world, they are the most comfortable dressed. Men are seen there with the dreadful chimney-pot hat, but there are very few hatless men; men wear the shocking swallow-tail coat, but few are to be seen with no coat and all. There is an air of comfort in the appearance of the people which is a marked contrast to that seen in this country; where, too often and, people are seen in close contact with rags.The next thing particularly noticeable is that everybody seems in a hurry to catch a train. This is a state of things which is not favorable to poetry or romance. Had Romeo or Juliet been in a constant state of anxiety about trains, or had their minds been agitated by the question ofreturn-tickets, Shakespeare could not have given us those lovely balcony scenes which are so full of poetry and pathos.参考译文美国印象(节录)王尔德我恐怕不能把美国描绘成十足的天堂—从一般的角度来说,也许我对这个国家所知甚少。

五年级上册英语一课一练Module3Unit3Exercise3∣牛津上海版

牛津上海版(试用本)2019-2019学年小学英语五年级上册Module 3 Places and activities Unit 3 Seeing the doctor Exercise 3一、将下列单词划线部分的发音归类1.读—读,按音标将下列单词划线部分的发音归类ruler aloud July garden jump full farmwork shoe driver hard number afraid butterglue money purple love book first partycook spoon third(1)/ɜː/________ ________ ________ ________(2)/uː/________ ________ ________ ________(3)/ɑː/ ________ ________ ________ ________(4)/ə/ ________ ________ ________ ________(5)/ʌ/ ________ ________ ________ ________(6)/u/ ________ ________ ________ ________二、选择最恰当的答案2.The sweets are bad ________ your teeth.A. atB. forC. off3.Kitty ________ well today. She's ill.A. isn't feelB. isn't feelingC. is feeling4.________ the small animals are afraid of the tigers.A. BothB. AllC. These5.You have a toothache. Let's go to see the ________.A. dentistB. firemanC. farmer6.—I have a toothache. What shouldn't I do?—You shouldn't ________.A. drink some waterB. eat lunchC. eat too many sweets7.The doctors work ________.A. in the post officeB. in the hospitalC. in the cinema8.You have a cold. You should take some ________.A. riceB. fruitC. medicine9.What's ________ with you?A. wrongB. the wrongC. matter10.—________ do you visit your grandfather?—Once a week.A. How manyB. What timeC. How many times11.—________ animal do you like best?—Pandas.A. WhichB. WhoseC. Where三、按要求改写下列句子12.The tiger likes eating small animals. (改成否定句)13.Don't eat too many sweets. (换一种说法,但意思不变)14.You should wear warm clothes. (对划线部分提问)15.My father goes to America by plane every month. (对划线部分提问)16.The mice are afraid of the cat. (对划线部分提问)17.I take the underground to get to the museum. (对划线部分提问)18.I like the pink shirt. (对划线部分提问)19.I have a cold. (根据答句写出问句)20.They are doctors. (改成单数句)21.Jill has lunch at school from Monday to Friday. (改成一般疑问句)答案解析部分一、将下列单词划线部分的发音归类1.【答案】(1)work;purple;first;third(2)ruler;shoe;glue;spoon(3)garden;farm;hard;party(4)aloud;driver;afraid;butter(5)jump;number;money;love(6)full;book;cook;July【考点】音标【解析】【分析】(1)work中字母or,purple中字母ur,first和third字母ir 发音都是/ɜː/,故答案为work,purple,first,third.(2)ruler中字母u,shoe中字母o,glue中字母u,spoon中字母oo发音都是/uː/ ,故答案为ruler,shoe,glue,spoon.(3)garden,farm,hard,party中字母ar发音都是/ɑː/ ,故答案为garden,farm,hard,party.(4)aloud中字母a,driver中字母er,afraid中字母a,butter中字母er发音都是/ə/ ,故答案为aloud,driver,afraid,butter.(5)jump和number中字母u,money和love中字母o发音都是/ʌ/ ,故答案为jump,number,money,love.(6)full中字母u,book和cook中字母oo,July中字母u发音都是/u/ ,故答案为full,book,cook,July.【点评】本题考查了字母发音,注意相同字母在不同单词的发音不一定相同。

五年级上册英语一课一练Module3Unit3Exercise3∣牛津上海版

牛津上海版〔试用本〕2019-2019学年小学英语五年级上册Module 3 Places and activities Unit 3 Seeing the doctor Exercise 3一、将以下单词划线局部的发音归类1.读—读 ,按音标将以下单词划线局部的发音归类ruler aloud July garden jump full farmwork shoe driver hard number afraid butterglue money purple love book first partycook spoon third〔1〕/ɜː/ ________ ________ ________ ________〔2〕/uː/ ________ ________ ________ ________〔3〕/ɑː/ ________ ________ ________ ________〔4〕/ə/ ________ ________ ________ ________〔5〕/ʌ/ ________ ________ ________ ________〔6〕/u/ ________ ________ ________ ________二、选择最恰当的答案2.The sweets are bad ________ your teeth.A. atB. forC. off3.Kitty ________ well today. She's ill.A. isn'tfeel B. isn'tfeeling C. is feeling4.________ the small animals are afraid of the tigers.A. BothB. AllC. These5.You have a toothache. Let's go to see the ________.A. dentistB. fireman C . farmer6.—I have a toothache. What shouldn't I do?—You shouldn't ________.A. drink some waterB. eatlunch C. eat too many sweets7.The doctors work ________.A. in the post officeB. in the hospitalC. in the cinema8.You have a cold. You should take some ________.A. riceB. fruitC. medicine9.What's ________ with you?A. wrongB. thewrong C. matte r10.—________ do you visit your grandfather?—Once a week.A. How manyB. Whattime C. How many times11.—________ animal do you like best?—Pandas.A. WhichB. Whose C . Where三、按要求改写以下句子12.The tiger likes eating small animals. (改成否认句)13.Don't eat too many sweets. (换一种说法 ,但意思不变)14.You should wear warm clothes. (对划线局部提问)15.My father goes to America by plane every month. (对划线局部提问)16.The mice are afraid of the cat. (对划线局部提问)17.I take the underground to get to the museum. (对划线局部提问)18.I like the pink shirt. (对划线局部提问)19.I have a cold. (根据答句写出问句)20.They are doctors. (改成单数句)21.Jill has lunch at school from Monday to Friday. (改成一般疑问句)答案解析局部一、将以下单词划线局部的发音归类1.【答案】〔1〕work;purple;first;third〔2〕ruler;shoe;glue;spoon〔3〕garden;farm;hard;party〔4〕aloud;driver;afraid;butter〔5〕jump;number;money;love〔6〕full;book;cook;July【考点】音标〔1〕work中字母or ,purple中字母ur ,first和third字母ir发音都是/ɜː/ ,【解析】【分析】故答案为work ,purple ,first ,third.〔2〕ruler中字母u ,shoe中字母o ,glue中字母u ,spoon中字母oo发音都是/uː/ ,故答案为ruler ,shoe ,glue ,spoon.〔3〕garden ,farm ,hard ,party中字母ar发音都是/ɑː/ ,故答案为garden ,farm ,hard ,party. 〔4〕aloud中字母a ,driver中字母er ,afraid中字母a ,butter中字母er发音都是/ə/ ,故答案为aloud ,driver ,afraid ,butter.〔5〕jump和number中字母u ,money和love中字母o发音都是/ʌ/ ,故答案为jump ,number ,money ,love.〔6〕full中字母u ,book和cook中字母oo ,July中字母u发音都是/u/ ,故答案为full ,book ,cook ,July.【点评】此题考查了字母发音 ,注意相同字母在不同单词的发音不一定相同。

Exercise 3练习题

Ⅰ. Match the examples on the left with the correct meaning of the underlined prefixes on the right.Ⅱ. Choose a word from the examples in ExerciseⅠto fill each gap. Write it in the correct form.1.We were all surprised when the king ______________________in favour of his son.2.I was so sad to hear of your uncle’s death. Please give your aunt my _____________.3.After his operation, the patient was fed ____________for several days.4.After four years in the company, he was finally _____________to senior manager.5.If the pilot presses this button, he _____________himself from the plane.6.We asked for _____________rooms at the hotel but they actually put us on differentfloors.7.It’s such a small island that most of the families there are _______________.8.The machine has started ________________ a strange, high-pitched sound.9.A lot of small businesses these days are finding it hard to stay _____________.10.D o you believe that there are ________________beings in outer space?Ⅲ. Match the roots from box A with suitable suffixes from box B to create new words. Use each root and suffix once only.A.B.Ⅳ. Complete these sentences using the suffixes from box B in exerciseⅢ. Use each suffix once only.1.She’s a highly ambitious, career-___________young woman.2.If you want to go swimming with a watch on it will have be water__________.3.He was guilt-__________ when he realized it was all his fault.4.Hilary’s a trust________________ person. I can think of no one better for the job.5.The British are thought to be more class-____________ than the Americans.6.Three staff-______________ protests have taken place in the company in the lastfew months.7.Sugar-_________ chewing gum is better for your teeth than the sugary stuff.8.Athletes often follow a protein-_________ diet to help build their muscles.9.I don’t want to discuss work-__________ issues outside of office hours.10.I don’t really think the new plan is work______________.。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

第三次作业1、两名参与者交替从一堆石子中取出若干数目,其个数由参与者自已决定.但是要求参与者每次至少取出一个,至多取出一半,然后另一名参与者继续.拿到最后一个石子的参与者将输掉该游戏.输入:输入开始时石子的个数输出:如果先取者输,则输出“lose”,否则输出“win”#include<iostream>#include<cmath>using namespace std;int main(){int number;cin>>number;double i=1;double k=pow(2.0,i)-1;while(k<number){++i;k=pow(2.0,i)-1;}if(k==number)cout<<"lose";if(k>number)cout<<"win";return 0;}2、Given some Chinese Coins (three kinds-- 1, 2, 5), and their number is num_1, num_2 and num_5 respectively, please output the minimum valuethat you cannot pay with given coins.InputInput contains multiple test cases. Each test case contains 3 positive integers num_1, num_2 and num_5 (0<=num_i<=1000). A test case containing 0 0 0 terminates the input and this test case is not to be processed.OutputOutput the minimum positive value that one cannot pay with given coins, one line for one case.#include<iostream>#include<cstdio>#include<cstring>using namespace std;const int MAX = 1000;const int type[3] = {1,2,5};bool ans[MAX]={0},tmp[MAX]={0};int cnt[3];void Search(){int i,j,k;for(i=0;i<=cnt[0];++i){ans[i]=true;}for(i=1;i<3;++i){for(j=0;j<MAX;++j){for(k=0;k<=cnt[i] && j+k*type[i]<=MAX;++k){if(tmp[j+k*type[i]] || ans[j])tmp[j+k*type[i]]=true;}}for(j=1;j<=MAX;++j){ans[j]=tmp[j];tmp[j]=false;}}}int main(){int res=0;scanf("%d %d %d",&cnt[0],&cnt[1],&cnt[2]);if(cnt[0]==0 && cnt[1]==0 && cnt[2]==0){printf("0");return 0;}Search();for(int i=0;i<=MAX;++i){if(!ans[i]){res=i;break;}}printf("%d",res);return 0;}3、写出完整的二分查找程序,要求:(1)先将给定的数据利用快速排序进行排序(采用复杂度为nlg(n)的算法)。

(2)利用二分查找法判断给定的数据是否在数据集中。

#include<iostream>#include<cstdio>using namespace std;void quicksort(int a[],int left,int right){if(left>=right)return;else{int first=left;int last=right;int key=a[first];while(first<last){while(first<last && a[last]>=key)--last;a[first]=a[last];while(first<last && a[first]<key)++first;a[last]=a[first];}a[first]=key;quicksort(a,left,first-1);quicksort(a,first+1,right);}}int search(int num,int a[],int size){int left=0;int right=size-1;int mid=(left+right)/2;while(left<=right){if(a[mid]==num)return mid;else if(a[mid]>num)right=mid-1;elseleft=mid+1;mid=(left+right)/2;}return 0;}int main(){int s[]={2,1,5,87,43,23,9};quicksort(s,0,6);int num=23;if(search(num,s,7))printf("给定的数据在数据集中!");elseprintf("给定的数据不在数据集中!");return 0;}4、Problem DescriptionYou are given a number of case-sensitive strings of alphabetic characters, find the largest string X, such that either X, or its inverse can be found as a substring of any of the given strings.InputThe first line of the input file contains a single integer t (1 <= t <= 10), the number of test cases, followed by the input data for each test case. The first line of each test case contains a single integer n (1 <= n <= 100), the number of given strings, followed by n lines, each representing one string of minimum length 1 and maximum length 100. There is no extra white space before and after a string.OutputThere should be one line per test case containing the length of the largest string found.Sample Input23ABCDBCDFFBRCD2roseorchidSample Output22#include<iostream>#include<cstring>#include<cstdio>using namespace std;char minstr[100];//最小字符串char str[100][100];//储存所有字符串char temp[100];//将要比较的字符串char strvel[100];//逆序的字符串int s[100];int result[100];int t=0;void Vel(char p[]){int Len=strlen(p);int i,k=Len;for(i=0;i<k;++i){strvel[i]=p[--Len];}strvel[k]='\0';}int Find(int num){int minLength=strlen(minstr);int i,j;int k=minLength;while(k){for(int i=0;i+k<=minLength;++i){strncpy(temp,minstr+i,k);temp[k]='\0';Vel(temp);for(j=0;j<num;++j){if(!strstr(str[j],temp) && !strstr(str[j],strvel))break;if(j==num-1){result[t++]=k;return k;}}temp[0]='\0';}--k;}result[t++]=k;return k;}int main(){int kind,number;int i;scanf("%d",&kind);while(kind--){int minLen=100;scanf("%d",&number);for(i=0;i<number;++i){scanf("%s",&str[i]);if(minLen>strlen(str[i])){minLen=strlen(str[i]);strcpy(minstr,str[i]);}}Find(number);}int j;for(j=0;j<t;++j){printf("%d\n",result[j]);}return 0;}5、用母函数求方程x1+x2+...+xk=m的所有正整数解的个数。

输入:两个整数k和m。

输出:方程解的个数。

要求构造相应的母函数,并实现两个多项式相乘的函数。

相关文档
最新文档