C语言题目及答案.doc

C语言题目及答案.doc

ID:52564163

大小:325.00 KB

页数:61页

时间:2020-03-28

C语言题目及答案.doc_第1页
C语言题目及答案.doc_第2页
C语言题目及答案.doc_第3页
C语言题目及答案.doc_第4页
C语言题目及答案.doc_第5页
资源描述:

《C语言题目及答案.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、目录1.ClimbtheTaishanMountain(II)2.Peach3.逆序输出数列4.逆序数5.计算高度6.分解质因数7.输出数字8.ProblemB:数字之和9.换零钱10.素数求和11.求阶乘和11.ProblemF:求一批正整数中的偶数和12.统计各种字符个数13.求最大公约数14.求最大公约数15.零起点学算法101——统计字母数字等个数16.网站泄密17.老外买瓷砖18.堆瓷砖19.新年大酬宾20.定制瓷砖21.句子比较大小22.鹦鹉学舌3——C语言初学者百题大战之十三23.鹦鹉学舌2——C语言初学者百题大战之十二24.百鸡问题25.零起点学算法89——程序设计竞赛26.零

2、起点学算法89——程序设计竞赛27.ProblemA:计算数列和28.找钱问题29.Median30.素月31.输入任意N个数,求和32.多项式求和33.人口问题34.数字菱形ClimbtheTaishanMountain(II)TimeLimit:1000MSMemoryLimit:65536KTotalSubmit:753Accepted:495DescriptionLabordayiscoming.Sincetheholidayislong,Manystudentsareplanningtohaveatour.TheTaishanMountainisverybeautiful,soWan

3、gPengandhisclassmateswanttoclimbtheTaishanMountain.MountaineeringsportsisWangPeng'savocation,soheisveryexcited.Suddenly,averyamusingideacomestohim.TheTaishanMountainhasmanystairs,andhecanclimbthemountainonestepby2stairsorby1stairs.Howmanywaysdoeshehavetoclimbthemountain?Forexample,thestairsis2,hehas

4、2ways.Thefirstoneisthefirststepby1stair,andthenextstepby1stair.Andthesecondwayisonlyonestepby2stairs.InputTheinputisincludingmanytestcases.EverylineisonetestcasewithaintegernumberN(N<=40).NisthestairsoftheTaishanMountain.OutputYoushouldoutputhowmanywaysWangPengcanclimbthemountain,eachcaseoutputaline

5、.SampleInput123SampleOutput123#includeintmain(){intn,i,j,a[41];while(scanf("%d",&n)!=EOF){a[0]=1;a[1]=2;for(i=2;i<40;i++){a[i]=a[i-1]+a[i-2];}printf("%d",a[n-1]);}}PeachTimeLimit:1000MSMemoryLimit:65536KTotalSubmit:689Accepted:495DescriptionAlmostallyoungmanknowMonkeySunwhosenameisSunWuko

6、ng.Onedayhestealsmanypeachesfromthekingdomofheaven.Firstday,heateahalfofthepeaches,thenateanotheroneoftheleftpeaches.Thenextday,heateahalfoftheleftpeaches,thenanotherone.Untilthen-thday,beforeheatehefoundonlyonepeach.PleasehelpSunWukongtocalculatehowmanypeacheshetookfromthekingdomofheaven.InputThein

7、putfilecontainsoneormoretestcases,eachlineisthedaysN(1intmain()

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。