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");
}
}
}
******************************人因为有理想、梦想而变得伟大,而真正伟大就是不断努力实现理想、梦想*****************************
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步