电脑显示不出我的错误,只有Wrong answer。阿里巴巴财富,输入总和输出一样




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 条评论

  • 1