您的位置:首页 > 其它

十二章 课后作业1

2016-09-11 17:56 169 查看
package dsl.com;

public class def {
public void s(){
System.out.println("春季");
}
public void w(){
System.out.println("夏季");
}
public void t(){
System.out.println("秋季");
}
public void r(){
System.out.println("冬季");
}

}

public class kehou1 {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input=new Scanner(System.in);
def o=new def();
System.out.println("请输入月份:");
int i=input.nextInt();
if(i==3||i==4||i==5){
o.s();
}else if(i==6||i==7||i==8){
o.w();
}else if(i==9||i==10||i==11){
o.t();
}else if(i==12||i==1||i==2){
o.r();
}

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: