日期:2014-05-20 浏览次数:20692 次
import java.util.Scanner;
public class Test
{
public static void main(String[] args)
{
double old = 5000;
Scanner sc = new Scanner(System.in);
int i = sc.nextInt(); //i代表月份
if (i <4)
{
if (i>0)
{
System.out.println("淡季:头等舱为" + old*0.5);
System.out.println("淡季:经济舱为" + old*0.4);
}
if (i<=0)
{
System.out.println("输入月份不正确");
}
}
if (i >= 4)
{
if (i < 11)
{
System.out.println("旺季:头等舱为" + old*0.9);
System.out.println("旺季:经济舱为" + old*0.8);
}
if (i >= 11)
{
if (i > 12)
{
System.out.println("输入月份不正确");
}
if (i <= 12)
{
System.out.println("淡季:头等舱为" + old*0.5);
System.out.println("淡季:经济舱为" + old*0.4);
}
}
}
}
}