1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
import java.util.Scanner;
public class A03 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input = new Scanner (System.in);
System.out.println( "请输入第一个数:" );
int num1=input.nextInt();
System.out.println( "请输入第二个数:" );
int num2=input.nextInt();
System.out.println( "请输入第三个数:" );
int num3=input.nextInt();
int x= 0 ;
if (num1>num2){
x=num1;
num1=num2;
num2=x;
} else if (num1>num3){
x=num1;
num1=num3;
num3=x;
} else if (num2>num3){
x=num2;
num2=num3;
num3=x;
}
System.out.println(num1+ " " +num2+ " " +num3);
}
}
|