System.out.println("请分别输入四个不同的数字:" );
Scanner scanner = new Scanner(System.in);
int a ,b,c,d;
a = scanner.nextInt();
b = scanner.nextInt();
c = scanner.nextInt();
d = scanner.nextInt();
scanner.close();
int min = a ;
if(min > b)
{
min = b;
}
if(min > c)
{
min = c;
}
if(min > d)
{
min = d;
}
System.out.println("min = " + min);
简单的代码,不是完整的可运行的,需要加上JAVA的类和主函数