package com.edu.jsu.demo2;
import java.util.Scanner;
public class qiaozui {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int aInt;
System.out.println("请输入一个整数:");
aInt = scan.nextInt();//输入一个整数
if(aInt > 0){//如果输入的整数大于0
System.out.println(aInt + "大于0!");
}
if(aInt == 0){//如果输入的整数等于0
System.out.println(aInt + "等于0!");
}
if(aInt < 0){//如果输入的整数小于0
System.out.println(aInt + "小于0!");
}
}
}
简单的if-else语句
![](https://img-home.csdnimg.cn/images/20240711042549.png)