标签:else print 收获 static input int jin 经济 ack
package Guanxi;
import java.util.Scanner;
public class YunSuan5 {
public static void main(String[] args) {
int piao =5000;
double jiyue;
double cang;
double wangtou=piao*0.9;
double wangjing=piao*0.8;
double dantou=piao*0.5;
double danjing=piao*0.4;
Scanner input = new Scanner(System.in);
System.out.println("你要几月去啊?");
jiyue=input.nextInt();
System.out.println("你坐头等舱还是经济舱?头等舱1,经济舱2");
cang=input.nextInt();
if(jiyue>=4&&jiyue<=10){
if(cang==1){
System.out.println("你头等舱的价格"+wangtou);
}else {
System.out.println("你的经济舱价格"+wangjing);
}
}
if(jiyue<4||jiyue>10){
if(cang==1){
System.out.println("你的头等舱价格"+dantou);
}else{
System.out.println("你的经济舱价格"+danjing);
}
}
}
}
标签:else print 收获 static input int jin 经济 ack
原文地址:http://www.cnblogs.com/XXHF/p/7827665.html