标签:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.Arrays;
public class Triangle{
public static void main(String[] args)throws IOException
{
String m=new String("");
int[] a={0,0,0};
BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));
System.out.println("enter three numbers:");
m=stdin.readLine();
Scanner scan=new Scanner(m);
for(int i=0;i<3;i++)
{
a[i]=scan.nextInt();
}
Arrays.sort(a);
System.out.println("sorted:");
for(int i=0;i<3;i++)
System.out.print(a[i]+" ");//升序排列
}
}
标签:
原文地址:http://www.cnblogs.com/sunshinewxz/p/4520932.html