慕氏理解switch
作者:互联网
import java.util.Scanner;
public class ZY{
public static void main (String[] args){
Scanner sc = new Scanner(System.in);
System.out.println("请输入月份");
int ma = sc.nextInt();
System.out.println("经济还是头等");
int mc = sc.nextInt();
double wa = 5000;
switch (ma){
case 2:
case 1:
case 3:
case 11:
case 12:
switch(mc){
case 1:
wa = wa * 0.5;
case 2:
wa = wa * 0.4;
break;
}
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
switch(mc){
case 1:
wa = wa * 0.9;
case 2:
wa = wa * 0.8;
System.out.println("价格"+ wa);
}
}
}
}
标签:case,wa,switch,System,慕氏,理解,sc,out 来源: https://blog.csdn.net/m0_62029458/article/details/121960322