c语言程序百例- - c语言(Cases of C language program - - C language).docVIP

  • 3
  • 0
  • 约9.14千字
  • 约 29页
  • 2018-06-05 发布于江西
  • 举报

c语言程序百例- - c语言(Cases of C language program - - C language).doc

c语言程序百例- - c语言(Cases of C language program - - C language).doc

c语言程序百例1-10 - c语言(Cases of C language program 1-10 - C language) Cases of C language program 1-10 The list of print Publisher: admin report to a friend Heat 47 votes 13562 views [5] [comment] time: I want to comment on 08 August 2009 17:16 [program 1] Title: 1, 2, 3, 4 numbers, three digit number can be composed with each other and not repeat the number? How much are they? 1. program analysis: can fill at 100, ten, a number is 1, 2, 3, 4. Make up all the permutations and then go An arrangement that does not meet the requirements. 2. program source code: (main) { Int i, J, k; Printf (\n); For (i=1; i5; i++) / * three * following heavy cycle For (j=1; j5; j++) For (k=1; k5; k++) { If (I =ki =jj =k!!!) to ensure I, J, K / * three different. Printf (%d,%d,%d\n, I, J, K); } } [program 2] Title: corporate bonuses based on profits. Profit (I) less than or equal to 100 thousand yuan, money can be raised 10% high profits; At 100 thousand yuan, less than 200 thousand yuan, less than 100 thousand yuan in part, according to 10% Commission, higher than 100 thousand yuan part, cocoa mention 7.5%; 200 thousand to 400 thousand, more than 200 thousand yuan, the Commission 5%; more than 400 thousand to 600 thousand. 400 thousand yuan part, can deduct a percentage from 3%; between 600 thousand and 1 million, higher than 600 thousand yuan part, can deduct a percentage of 1.5%, higher than 1 million yuan, more than 1 million yuan part of the Commission by 1%, from the keyboard input month profit I, ask the total bonus should be awarded? 1. program analysis: please use a few axes to boundaries, positioning. Note that the definition needs to define integer growth bonus. 2. program source code: (main) { Long int i; Int bonus1, bonus2, bonus4, bonus6, bonus10, bonus; Scanf (%ld, i); 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; Else if (i=200000) Bonus=bonus1+ (i-100000) *0.075; Else i

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档