c语言练习题(exercises in c language)

c语言练习题(exercises in c language)

ID:17562998

大小:33.39 KB

页数:56页

时间:2018-09-03

c语言练习题(exercises in c language)_第1页
c语言练习题(exercises in c language)_第2页
c语言练习题(exercises in c language)_第3页
c语言练习题(exercises in c language)_第4页
c语言练习题(exercises in c language)_第5页
资源描述:

《c语言练习题(exercises in c language)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、c语言练习题(ExercisesinClanguage)Program1Title:1,2,3,4numbers,threedigitnumbercanbecomposedwitheachotherandnotrepeatthenumber?Howmucharethey?1.programanalysis:canfillat100,ten,anumberis1,2,3,4.Thenremovethearrangementdoesnotmeettheconditionwhichallarranged.2.progr

2、amsourcecode:(main){Inti,J,k;Printf("");For(i=1;i<5;i++)/*three*followingheavycycleFor(j=1;j<5;j++)For(k=1;k<5;k++){If(I=k&&i=j&&j=k!!!)toensureI,J,K/*threedifferent.Printf("%d,%d,%d",I,J,K);}}==============================================================

3、[program2]Title:corporatebonusesbasedonprofits.Profit(I)lessthanorequalto100thousandyuan,bonus10%;profitmorethan100thousandyuan,lessthan200thousandyuan,100thousandyuanlessthanthepartofthe10%Commission,morethan100thousandyuan,plus7.5%to200thousandcocoa;400thou

4、sand,morethan200thousandyuan,theCommission5%;400thousandto600thousandwhenmorethan400thousandyuan,theCommission3%;600thousandto1million,morethan600thousandyuan,totheCommissionof1.5%,higherthan1millionyuan,morethan1millionyuanpartofthe1%Commission,monthlyprofit

5、sfromthekeyboardinputI,seekthetotalnumberofbonuses?1.programanalysis:pleaseuseafewaxestoboundaries,positioning.Notethatthedefinitionneedstodefineintegergrowthbonus.2.programsourcecode:(main){Longinti;Intbonus1,bonus2,bonus4,bonus6,bonus10,bonus;Scanf("%ld",&i

6、);Bonus1=100000*0.1;bonus2=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)B

7、onus=bonus4+(i-400000)*0.03;Elseif(i<=1000000)Bonus=bonus6+(i-600000)*0.015;ElseBonus=bonus10+(i-1000000)*0.01;Printf("bonus=%d",bonus);}==============================================================[program3]Title:aninteger,plus100,isaperfectsquarenumber,plu

8、s168isacompletesquarenumber,whatisthenumber?1.programanalysis:judgmentinlessthan100thousand,thenumberofthefirstand100aftertheroot,thenthenumberofplus268afterprescribing,ifafterprescribing

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

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

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