要不然你就干脆用三元表达式来实现吧(别把a,b,c的值换来换去的了):
public class hello {
public static void main(String args[]){
int a=9,b=7,c=5;
System.out.println(
"a=" + ((a <= b && a <= c) ? a : ((b <= a && b <= c) ? b : (c <= a && c <= b) ? c : 0)) +
",b=" + ((a <= b && a >= c) ? a : ((b <= a && b >= c) ? b : (c <= a && c >= b) ? c : 0)) +
",c=" + ((a >= b && a >= c) ? a : ((b >= a && b >= c) ? b : (c >= a && c >= b) ? c : 0))
);
}
}