import java.util.*;
class Test
{
public static void main(String[]args)
{
int month=0,seat=0;
try{
Scanner s=new Scanner(System.in);
System.out.println("輸入月份:");
month =s.nextInt();
System.out.println("輸入艙位,頭等艙為1,經濟艙為2:");
seat=s.nextInt();
}catch(Exception e){
System.out.println("請輸入整數!");
}
while(seat!=-1&& month!=-1){
if(month>=4&&month<=10)
{
if(seat==1)
System.out.println("您的機票價為4500RMB");
else if(seat==2)
System.out.println("您的機票價為4000RMB");
else
System.out.println("您輸入的艙位代號有誤");
}
else if(month>0&&month<4 || month>10&&month<=12)
{
if(seat==1)
System.out.println("您的機票價為2500RMB");
else if(seat==2)
System.out.println("您的機票價為2000RMB");
else
System.out.println("您輸入的艙位代號有誤");
}else{
System.out.println("您輸入的月份有誤");
}
try{
Scanner s=new Scanner(System.in);
System.out.println("輸入月份:");
month =s.nextInt();
System.out.println("輸入艙位,頭等艙為1,經濟艙為2:");
seat=s.nextInt();
}catch(Exception e){
System.out.println("請輸入整數!");
}
}
}
}