经典c语言例程个例程(classic c language routines, routines)

经典c语言例程个例程(classic c language routines, routines)

ID:15455323

大小:85.00 KB

页数:60页

时间:2018-08-03

经典c语言例程个例程(classic c language routines,  routines)_第1页
经典c语言例程个例程(classic c language routines,  routines)_第2页
经典c语言例程个例程(classic c language routines,  routines)_第3页
经典c语言例程个例程(classic c language routines,  routines)_第4页
经典c语言例程个例程(classic c language routines,  routines)_第5页
资源描述:

《经典c语言例程个例程(classic c language routines, routines)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、经典c语言例程39个例程(ClassicClanguageroutines,39routines)[recommendedreading]classicClanguageroutines,atotalof39routines,748495575[program1]Title:1,2,3,4numbers,howmanydifferentnumberscanbeformedwithouteachotherandthreedigits?Howmucharethey?1.,programanalysis:canfillinonehundred,ten,anumberofdigits

2、are1,2,3,4.MakeupallthepermutationsandthengoAnarrangementthatdoesnotmeettherequirements.2.programsourcecode:(main){Int,I,J,k;Printf("");For(i=1;i<5;i++)For(j=1;j<5;j++)For(k=1;k<5;k++){If(I,=k&&i,=j&&j,=k!)Printf("%d,%d,%d",I,J,K);}}[program2]Title:bonusespaidbyenterprisesarebasedonprof

3、its.Whentheprofit(I)isbeloworequalto100thousandyuan,thebonuscanberaisedby10%;theprofitishighAt100thousandyuan,lessthan200thousandyuan,lessthan100thousandyuaninpart,accordingto10%Commission,higherthan100thousandyuaninpart,cocoamentionIn7.5%,between200thousandand400thousand,apercentageof200th

4、ousandyuanis5%Commission;between400thousandand600thousandishigher400thousandyuanpart,candeductapercentagefrom3%;between600thousandand1millionwhen,above600thousandyuanpart,candeductapercentageof1.5%,behigherthan1millionyuan,morethan1millionyuaninpart,accordingto1%Commission,fromthekeyboardin

5、putmonthprofitsI,begshouldbeawardedbonustotal?1.programanalysis:pleaseuseafewaxestoboundaries,positioning.Whendefiningthedefinition,youneedtodefinethebonusasagrowthinteger.2.programsourcecode:(main){Longinti;Int,bonus1,bonus2,bonus4,bonus6,bonus10,bonus;Scanf("%ld",&i);Bonus1=100000*0.1;bon

6、us2=bonus1+100000*0.75;Bonus4=bonus2+200000*0.5;Bonus6=bonus4+200000*0.3;Bonus10=bonus6+400000*0.15;If(i<=100000)Bonus=i*0.1;Elseif(i<=200000)Bonus=bonus1+(i-100000)*0.075;Elseif(i<=400000)Bonus=bonus2+(i-200000)*0.05;Elseif(i<=600000)Bonus=bonus4+(i-400000)*0.03;Elseif(i<=1000000)Bonus=bon

7、us6+(i-600000)*0.015;ElseBonus=bonus10+(i-1000000)*0.01;Printf("bonus=%d",bonus);}[program3]Title:aninteger,plus100,isaperfectsquare,plus168isaperfectsquarenumber.What'sthenumber?1.programanalysis:judgmentinlessthan100thousand,thenumberofthefirstand100af

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

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

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