解题思路:
注意事项:
参考代码:
import java.util.Scanner;
public class Main { public static void main(String[] args) { Scanner scanner=new Scanner(System.in); double a=0; int y=scanner.nextInt(); if (y<=100000){ a=y*0.1; }else if (y>100000&&y<=200000){ a=100000*0.1+(y-100000)*0.075; }else if (y>200000&&y<=400000){ a=100000*0.1+(y-100000)*0.075+(y-200000)*0.05; }else if (y>400000&&y<=600000){ a=100000*0.1+(y-100000)*0.075+(y-200000)*0.05+(y-400000)*0.03; }else if (y>600000&&y<=1000000){ a=100000*0.1+(y-100000)*0.075+(y-200000)*0.05+(y-400000)*0.03+(y-600000)*0.015; }else if (y>1000000){ a=100000*0.1+(y-100000)*0.075+(y-200000)*0.05+(y-400000)*0.03+(y-600000)*0.015+(y-1000000)*0.01; } System.out.println((int)a); } }
0.0分
0 人评分