- 问答
- 2019-04-11 10:36:40 @
import java.util.Scanner;
import java.io.PrintStream;
public class Main {
public static void main(String[] args) throws java.io.UnsupportedEncodingException {
PrintStream ps = new PrintStream(System.out, true, "UTF-8");
Scanner in = new Scanner(System.in);
int money = in.nextInt();
int shanggong;
double shui;
if (money > 0 && money <= 500) {
shanggong = 0;
shui = 0;
ps.println(money);
}
if (money > 500 && money <= 3600) {
shanggong = (money - 500)*(3/100);
shui = (money - 500)*(3/100);
ps.println(money-shui);
}
if (money > 3600 && money <= 14400) {
shanggong = (money - 3600)*(10/100);
shui = 3100*(3/100) + (money - 3600)*(10/100);
ps.println(money - shui);
}
if(money > 14400 && money <= 30000) {
shanggong = (money - 14400)*(20/100);
shui = 3100*(3/100) + 10800*(10/100) + (money - 14400)*(20/100);
ps.println(money - shui);
}
if (money > 30000) {
shanggong = (money - 30000)*(50/100);
shui = 3100*(3/100) + 10800*(10/100) + 15600*(20/100) + (money - 30000)*(50/100);
ps.println(money - shui);
}
}
}```
2 条评论
-
wyx2018 LV 4 @ 2019-04-11 11:00:05
21739.0
-
2019-04-11 10:44:58@
如你在eclipse里运行,输入21736,是啥结果?
- 1