刚学了 但是基础不好 完全没有思路 和定义语法
实在想不出来怎么弄 有没有人来帮忙传授下知识
收起
import java.util.Scanner;
public class Base {
public static void main(String[] args) {
double tickt=4000;
System.out.println("请输入出行月份");
Scanner scanner=new Scanner(System.in);
int month=scanner.nextInt();
System.out.println("请输入舱型 1:头等舱,2:经济舱");
int type=scanner.nextInt();
if(month>=4&&month<=10&&type==1){
tickt=tickt0.9;
}else if(month>=4&&month<=10&&type==2){
tickt=tickt0.75;
}else if((month<4||month<=10)&&type==1){
tickt=tickt0.6;
}else if((month<4||month<=10)&&type==2){
tickt=tickt0.3;
}
System.out.println("票价为"+tickt);
}
}
报告相同问题?