import java.util.Scanner;

public class k21 {
public static void main(String[] args){
double price=0.0;//定义可征税的收入
int status=0;//纳税人的情况
double tax=0;//应缴税额
Scanner in=new Scanner(System.in);
System.out.print("请输入纳税人的类型:【0-单身,1-已婚,2-家庭】");
if(in.hasNextInt()){
status=in.nextInt();
}
System.out.print("请收入可征税的收入:");
Scanner in2=new Scanner(System.in);
if(in2.hasNextDouble()){
price=in2.nextDouble();
}
if(status==0){//计算单身纳税人的缴纳税额
if(price<=6000)
tax=price*0.1;
else if(price<=27950)
tax=price*0.1+(price-6000)*0.15;
else if(price<=67700)
tax=price*0.1+(27950-6000)*0.15+(price-27950)*0.27;
else if(price<=141250)
tax=price*0.1+(27950-6000)*0.15+(67700-27950)*0.27+(price-67700)*0.3;
else
tax=price*0.1+(27950-6000)*0.15+(67700-27950)*0.27+(141250-67700)*0.3+(price-141250)*0.35;
}
else if(status==1){//计算已婚纳税人的缴纳税额
if(price<=12000)
tax=price*0.1;
else if(price<=46700)
tax=price*0.1+(price-12000)*0.15;
else if(price<=112850)
tax=price*0.1+(46700-12000)*0.15+(price-46700)*0.27;
else if(price<=171950)
tax=price*0.1+(46700-12000)*0.15+(112850-46700)*0.27+(price-112850)*0.3;
else
tax=price*0.1+(46700-12000)*0.15+(112850-46700)*0.27+(171950-112850)*0.3+(price-171950)*0.35;
}
else if(status==2){//计算家庭纳税人的缴纳税额
if(price<=10000)
tax=price*0.1;
else if(price<=37450)
tax=price*0.1+(price-10000)*0.15;
else if(price<=96700)
tax=price*0.1+(37450-10000)*0.15+(price-37450)*0.27;
else if(price<=171950)
tax=price*0.1+(37450-10000)*0.15+(96700-37450)*0.27+(price-96700)*0.3;
else
tax=price*0.1+(37450-10000)*0.15+(96700-37450)*0.27+(156601-96700)*0.3+(price-156601)*0.35;
}
else{
System.out.println("请输入正确的纳税人身份!");
}
System.out.println("纳税人应缴纳的税额为:"+tax);

}

}