import java.util.Scanner;
public class test {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("请您输入原机票的价格:");
double price = scan.nextDouble();
System.out.println("请输入您出行的月份1~12:");
int month = scan.nextInt();
System.out.println("请问您选择的是头等舱还是经济舱?头等舱输入1,经济舱输入2:");
int site = scan.nextInt();
double lastPrice = 0;
if(month == 1 || month == 2 || month == 3){
if(site == 1){
lastPrice = price * 0.6;
}else if(site == 2){
lastPrice = price * 0.3;
}
}else{
if(site == 1){
lastPrice = price * 0.9;
}else if(site == 2){
lastPrice = price * 0.75;
}
}
System.out.println("您的机票价格为:" + lastPrice);
}
}