谁能告诉我,在java里,怎么写一个方法,能够求出三个数的大小,然后从大到小输出呀。
------解决方案--------------------
public void compare(int x,int y,int z){
//取最大
int max = Math.max(Math.max(x,y),z);
int min = Math.min(Math.min(x,y),z);
int mid=x+y+z-max-min;
System.out.println( "max = " + max);
System.out.println( "mid = " + middle);
System.out.println( "min = " + min);
}