java--if判断

package test_1027;

import java.util.Scanner;

public class test {

public static void main(String[] args) {
// TODO Auto-generated method stub
//System.out.println("a");

Scanner sc = new Scanner(System.in);
System.out.println("please:");
int a= sc.nextInt();
if(a >=1 && a<=3 ) {
System.out.println("春天");
}else if(a>=4 && a<=6 ) {
System.out.println("夏天");
}else if(a>=7 && a<=9 ) {
System.out.println("秋天");
}else if(a>=10 && a<=12 ) {
System.out.println("冬天");
}else {
System.out.println("ERROR");
}
}

}

posted @ 2020-10-27 15:02  雨曼晴川  阅读(156)  评论(0)    收藏  举报