代码
/**
*
*/
/**
* @author Administrator
*
*/
package ccf_1;
import java.util.Scanner;
public class Example3_2{
public static void main(String args[]){
System.out.println("Please input three integers:");
Scanner sc = new Scanner(System.in);
int[] a= new int[3];
int t=0;
for(int i=0;i<3;i++){
a[i] = sc.nextInt();
}
if(a[1]<a[0]){
t = a[0];
a[0] = a[1];
a[1]= t;
}
if(a[2]<a[0]){
t = a[0];
a[0] = a[2];
a[2]= t;
}
if(a[2]<a[1]){
t = a[1];
a[1] = a[2];
a[2]= t;
}
System.out.println("The order from small integer to big integer is: "+a[0]+","+a[1]+","+a[2]);
}
}
结果