- import java.util.Scanner;
- class JiangJin
- {
- public static void main(String[] args)
- {
- long m=0;double jj=0; //定义利润为m,奖金为jj
- System.out.println("请输入利润数");
- Scanner sc = new Scanner(System.in); //输入流
- m = sc.nextInt();
-
-
- if(m>=0 && m<=100000){ //判断利润大于等于0并且小于等于10
- jj = m*0.1; //低于10万的奖金
- }
- else if(m>100000 && m<=200000){ //判断利润大于10并且小于等于20
- jj = 100000*0.1 + (m-100000)*0.075; //10万的奖金+剩余利润的奖金(11-20之间)
- }
- else if(m>200000 && m<=400000){ //判断利润大于20并且小于等于40
- jj = 100000*0.1 + 100000*0.075 + (m-200000)*0.05; //10万的奖金+(10-20之间)奖金+剩余利润的奖金(21-40之间)
- }
- else if(m>400000 && m<=600000){ //判断利润大于40并且小于等于60
- jj = 100000*0.1 + 100000*0.075 + 200000*0.05 + (m-400000)*0.03; //10万的奖金+(10-20之间)奖金+(20-40之间)奖金+剩余利润的奖金(41-60之间)
- }
- else if(m>600000 && m<=1000000){ //判断利润大于60并且小于等于100
- jj = 100000*0.1 + 100000*0.075 + 200000*0.05 + 200000*0.03 + (m-600000)*0.015; //10万的奖金+(10-20之间)奖金+(20-40之间)奖金+(40-60之间)+剩余利润的奖金(60-100之间)
- }
- else if(m>1000000){ //判断利润大于100
- jj = 100000*0.1 + 100000*0.075 + 200000*0.05 + 200000*0.03 + 400000*0.015 + (m-1000000)*0.001; //10万的奖金+(10-20之间)奖金+(20-40之间)奖金+(40-60之间)+(60-100之间)+大于100的奖金
- }
- System.out.println("利润为"+m+"奖金为"+jj+"元");
- }
- }
复制代码 |