日期:2014-05-20 浏览次数:20758 次
import java.util.Scanner;
public class s {
public static void main(String [] args){
Scanner in = new Scanner(System.in);
System.out.println("Enter three number,please");
int a = in.nextInt();
int b = in.nextInt();
int c = in.nextInt();
max(a,b,c);
in.close();
}
/*----max method part----*/
static void max(int a,int b,int c){
int t = 0;
if(a<b){
t=a;a=b;b=t;
}
if(a<c){
t=a;a=c;c=t;
}
if(b<c){
t=b;b=c;c=t;
}
System.out.println("Sorted Order : "+a+" "+b+" "+c);
}
}
Enter three number,please
3 4 5
Sorted Order : 5 4 3